将鼠标悬停在文本上以显示标记标题

时间:2014-11-27 20:28:48

标签: jquery

<a href="#" id="magic"
 title="This is my sample.">
 Hover over this text</a>
<script>

    $('#magic').hover(function () { $(this).show('title') } );


</script>

当用户在文本上悬停时,我试图在标签旁边的标签中显示标题

1 个答案:

答案 0 :(得分:0)

使用此代码仅适用于HTML / CSS

<a href="#" id='myA' title='this is title'> this is text</a>

这种风格:

#myA:hover:after{
    content:attr(title);
    color:red
}

jsFiddle

相关问题