I have a form that I am working with that has a bit of unwrapped text. I have no access to the HTML file so the only way I'm going to be able to select it is through Jquery (so I've been told). This is what the HTML looks like:
<div class="input-entry">
<div class="input-area">
<div class="input-checkbox">
<input type="checkbox" name="accept">
I Accept
</div>
</div>
</div>
I need to select the 'I Accept' to wrap a <label>
around it. I don't know very much about jQuery but I did try this:
$("div.input-area:contains('I Accept')").wrap("<label for='accept'></label>");
Which I thought at first glance would work but I miss interpreted what the :contains
selector does.
Is it possible to simply wrap it using Jquery?