获取java脚本中的函数以返回打开和关闭HTML标记 [英] Get a function in java script to return opening and closing HTML tags
本文介绍了获取java脚本中的函数以返回打开和关闭HTML标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
// getHTMLTag takes in a tag name
// and returns the opening and closing tag
// Example: getHTMLTag('div') would return '<div></div>'
我在课堂上遇到这个问题,它需要在js中使用一个函数。 />
我的尝试:
im stuck on this problem in class, it needs to be using a function in js.
What I have tried:
function getHTMLTag(tagName) {
var tag = '<tagName>'+ '</tagName>';
return tag;
推荐答案
您已在Javascript论坛中发布此内容。请不要重新发布相同的问题。
You already posted this in the Javascript forum. Please do not repost the same questions.
这篇关于获取java脚本中的函数以返回打开和关闭HTML标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文