如何在标题属性中转义双引号 [英] How to escape double quotes in a title attribute
本文介绍了如何在标题属性中转义双引号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用在锚的title属性中包含双引号的字符串。到目前为止,我尝试了这些操作:
I am trying to use a string that contains double quotes in the title attribute of an anchor. So far I tried these:
<a href=".." title="Some \"text\"">Some text</a>
<!-- The title looks like `Some \` --!>
和
<a href=".." title="Some "text"">Some text</a>
<!-- The title looks like `Some ` --!>
请注意,使用单引号不是。
推荐答案
此变体-
<a title="Some "text"">Hover me</a>
是正确的,并且可以正常工作-您在呈现的页面中看到正常的引号。
Is correct and it works as expected - you see normal quotes in rendered page.
这篇关于如何在标题属性中转义双引号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文