对不起,jQuery完全不熟悉。我想知道如何获得title属性并将其附加到href标记的内部html中。我无法修改html源代码,但我必须能够将标题文本附加到href标记内的文本末尾。感谢帮助社区。jQuery如何显示标题属性并附加到内部html
<script style="text/javascript">
$(document).ready(function()
{
$("#part4 > a").mouseover(function() {
$(this).next().html(("#part4 > a").attr("title")).toggle();
});
$("#part4 > a").mouseout(function() {
$(this).next().html(("#part4 > a").attr("title")).toggle();
});
});
</script>
<div id="part4">
<h2>4: Link and Title Attribute Demo</h2>
<a href="#" id="linkTitle" title="This is text from the title attribute, wrapped in a span tag, placed here by jquery.">
Hover over this text</a>
</div>