代码如下,如何把下面代码中Guest - Guest 增加一个A标签?目前只知道如何取这个值.我想把html 中所有没有被包装成标签的都给包一层,这样可以便于后续操作
<li id="test" value="0"> Guest - Guest <ul class="task-list"> <li>Role = $everyone, $unauthenticated</li> <li> Has access to the "List projects" function, but none of the others </li> </ul> </li>
var test=$("#test").contents().filter(function() {//取值 return this.nodeType === 3; })[0].nodeValue;
桃花长相依
相关分类