我是网络编程新手,正在学习 VBScript。我想使用 HTML 标签在表单中显示几个文本框。但是当使用此语句创建文本框时 - document.write("input type="text"") 出了点问题并且网页中没有显示任何内容。我知道我可以在脚本块之外使用 HTML 创建文本框,但是我们可以在 document.write 中执行吗?
问问题
4848 次
3 回答
1
你可以这样做
<script language=vbscript>
document.write("input type='text'") '=> input type="text"
document.write("input type=""text""") '=> input type="text"
'as suggested in other answer won't work
'document.write("input type=\"text\"")
'document.write("input type='text'")
</script>
于 2012-06-18T11:38:33.073 回答
0
尝试以下 2 个选项中的 1 个:
- document.write("输入类型=\"文本\"")
- document.write("输入类型='文本'")
您正在使用双引号将您的 doc.write 函数传递其参数,因此如果您再次使用双引号,则必须将它们转义,或者在“文本”周围使用单引号
于 2012-06-18T11:24:20.193 回答
0
始终在字符串中使用两个引号 ("") 来表示单引号。
示例字符串 - “亚历克斯:“你好吗”,他说”
Wscript.Echo "Alex : ""how are you"", he said" ' 使用双引号
当您尝试在 wbscript 中插入 html 标记时也是如此。希望这可以帮助。
于 2012-06-18T15:55:03.847 回答