javascript – 这些符号在html中意味着什么?

我在浏览
jquery工具提示时发现了这段代码.请建议我们为什么使用某些代码,这是什么意思?

 <pre class="prettyprint">
 &lt;head&#62;

   &lt;script&#62;
    $(document).ready(function() {
        $('.tooltip').tooltipster({
            contentAsHTML: true
        });
    });
&lt;/script&#62;
&lt;/head&#62;
&lt;body&#62;

&lt;div class="tooltip" title="&amp;lt;img src=&amp;quot;my-  image.png&amp;quot; /&amp;gt; &amp;lt;strong&amp;gt; This text is in bold case   !&amp;lt;/strong&amp;gt;"&gt; 
    This div has a tooltip with HTML when you hover over it!
&lt;/div&#62;

&lt;/body&#62;</pre>

最佳答案 您输入的代码是html编码的,这意味着使用html特殊字符:

<script>
    $(document).ready(function() {
        $('.tooltip').tooltipster({
            contentAsHTML: true
        });
    });
</script>
</head>
<body>

<div class="tooltip" title="<img src=my-image.png /> <strong> This text is in bold case!</strong>"> 
    This div has a tooltip with HTML when you hover over it!
</div>

</body></pre>

ISO-8859-1是HTML 4.01中的默认字符,请参阅list of XML and HTML character以获取更多信息.

例如,“& lt;”是“<” (小于号,U 003C) 当用户将鼠标放在包含文本的div上时,您尝试理解的代码会创建工具提示

This div has a tooltip with HTML when you hover over it!

toolpit的内容位于title标签之间,所以

<img src=my-image.png /> <strong> This text is in bold case!</strong>

img是显示图片蚂蚁之间强烈的文字…很强:-)

点赞