我有下一个html:
<label for="user_name">
<abbr title="required">*</abbr>
Name
</label>我想用jquery把标签标题改成Title。我就是这么做的
$('label[for=user_name]').html('Title')它取代了所有的内部html (包括abbr标签)
那么,最简单的替代Name的方法是什么呢
发布于 2013-03-15 01:23:59
很抱歉这么晚才回复...但这里有一种仅使用jQuery实现此目的的方法:
$('label').contents().last().replaceWith('Title');https://stackoverflow.com/questions/9956388
复制相似问题