如何在html输入值中有引号 [英] how to have quotation marks in html input values
本文介绍了如何在html输入值中有引号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
i想把这个字符串放入一个
<输入值MYSTRING/>
,这样会导致类似于< input valuehoschibrother/>
这显然不起作用。 任何解决方法?
会转义字符,
& quot;
在值标签内工作?
感谢您的帮助,
tobi
解决方案
code>& quot; works:
< input type =text name =last_namevalue =& quot;我的报价!& quot;/>
i have following problem - from the server side i get a string like 'hoschi"brother'
i want to put this string into a <input value"MYSTRING" />
. this results in something like
<input value"hoschi" brother" />
which obviously does not work.
any workarounds for this?
does escaping the "
character with "
work within the value tag?
thanks for your help, tobi
解决方案
Yes, using "
works:
<input type="text" name="last_name" value=""My quote!"" />
这篇关于如何在html输入值中有引号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文