Using jQuery. I have the following html:
<input type="checkbox" name='something' value='v1' /> All the world <br />
How would I get ONLY the text. what selector should I use? (I need the "All the world")
I also can not touch the HTML...
Try using the DOM function .nextSibling to pick the next node (including the text nodes) and use nodeValue to get the text All the world
.nextSibling
nodeValue
All the world
$(':checkbox')[0].nextSibling.nodeValue
1.4m articles
1.4m replys
5 comments
57.0k users