我有一个即时生成标记的网站(Wordpress3.5),所以我不能直接将数据工具提示添加到 html 中。因此,我试图通过 Javascript 添加属性。在提供的小提琴中,我添加了一些示例 HTML,有人可以帮助这个小提琴尝试成功地将“工具提示”添加到标记或解释为什么我的脚本当前无法正常工作吗?谢谢。
// set the tooltip content
jQuery('li#menu-item-75 a:hover:before').prop('tooltipText', 'w00t');
jQuery('li#menu-item-75 a:hover:after').prop('tooltipText', 'w00t');