日期:2014-05-17  浏览次数:20448 次

js如何获取span的title值
如题 谢谢

------解决方案--------------------
JScript code

document.getElementById("id").title

------解决方案--------------------
jQuery('#spanid').attr("title");
------解决方案--------------------
<span id = 'span1' title = 'test'>


$('#span1').title


document.getElementById('span1').title
------解决方案--------------------
错了。

<span id = 'span1' title = 'test'>


$('#spanid').attr("title");


document.getElementById('span1').title

应该是这样。