因為英語水平差,想做個瀏覽器插件:在每個英文下,插入一個中文翻譯而不改變原網(wǎng)站結(jié)構(gòu),然后jquery $().text()方法會把元素下所有text都給提取出來,比如下面的<li><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>如果用$("#test").text(); 取出來的值是所有TEXT,如下"Guest - GuestRole = $everyone, $unauthenticatedHas access to the "List projects" function, but none of the others",我該如何做才能只取當前的這個值呢?
jquery如何取當前元素的text?
滄海一幻覺
2018-09-11 13:13:43