Here's some example code:
<input type="checkbox" id="send-notice" name="send-notice" value="1" /> This is a notice to all users.
<label for="subject">Subject</label>
I want to be able to select the text "This is a notice to all users." so I can remove it.
I'm not sure how to do so though.
I've tried using jQuery('#send-notice').next()
, but that selects the <label for="subject">
block.
I also tried wrapping a <div>
around the text using jQuery('#send-notice').after()
and a closing </div>
tag on jQuery("label[for='subject']").before()
. But jQuery doesn't like unopened elements.
Any help here?