我想在我的输入标签值中显示 123
我写这个: < INPUT TYPE =textNAME =value =12 \3>但它不正确
WHY ?
PS:我必须将转移至& quot; ,或将更改为'?我不喜欢它
解决方案HTML没有像其他语言一样的转义序列。在HTML属性值中,唯一的特殊字符是< ,& ,并且取决于引号或',并且唯一使用这些字符的是字符引用:
有些作者使用字符实体引用& quot; 来编码双引号标记()的实例,因为该字符可能用于分隔属性值。
或者您使用单引号,则不需要对双引号进行编码,反之亦然:
< INPUT TYPE =textNAME =value = '123'>
i want show 12"3 in my input tag value
i write this:
<INPUT TYPE="text" NAME="" value="12\"3">but it's not be right
WHY ?
PS: i must transfer " to " ,or change " to '? i don't like it
解决方案HTML simply does not have escape sequences like other languages. In HTML attribute values the only special characters are <, & and depending on the quotes " or '. And the only to use these characters are character references:
Some authors use the character entity reference """ to encode instances of the double quote mark (") since that character may be used to delimit attribute values.
Or you use single quotes, then you don’t need to encode the double quotes and vice versa:
<INPUT TYPE="text" NAME="" value='12"3'>
更多推荐
为什么不能使用\“在HTML输入标签?
发布评论