解决方法
为此使用
.text()
:
alert($(this).text());
如果您想要标记(.text()
删除标签等),请使用.html()
@H_403_5@
alert($(this).html());
在这种情况下,没有什么区别,如果你有这样的话:@H_403_5@
<a href="http://www.google.com/">Google <span>(External)</span></a>
那就是:@H_403_5@
$(this).text() //"Google (External)" $(this).html() //"Google <span>(External)</span>"