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
$(':checkbox')[0].nextSibling.nodeValue