[英]Is there a global HTML attribute like title or alt that i can use to store text for a tooltip dialog?
I use jquery to render a tooltip when i move my mouse hover some html tags. 当我移动鼠标悬停一些html标签时,我使用jquery渲染工具提示。 In this case it's the span tag.
在这种情况下,它是span标记。 I would like to store in that span tag the text to be displayed into the tooltip.
我想在该span标签中存储要显示在工具提示中的文本。
I use most span tag but if i store my text into "title" attribute, my browser shows also a tooltip dialog 我使用大多数span标签,但如果我将文本存储到“title”属性中,我的浏览器也会显示工具提示对话框
I'd suggest using a custom data-*
attribute, such as (for example): 我建议使用自定义
data-*
属性,例如(例如):
<span data-tooltipText="text to show with the tooltip plugin">Text here</span>
These attributes are valid under HTML 5 (and will work under HTML 4, albeit they won't validate). 这些属性在HTML 5下有效(并且将在HTML 4下工作,尽管它们不会验证)。
References: 参考文献:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.