I have some elements in my document like:
<div class="checkbox-inline">
<label><input id="myinputid" value="False" type="checkbox"/>mytext</label>
</div>
I can access get the text using:
$("#myinputid").parent().text();
This returns mytext
as I had hoped it would. That is:
$("#myinputid").parent().text("newtext");
Changes my initial element to
<div class="checkbox-inline"><label>newtext</label></div>
How can I change the text part without removing the input? Or do I have to reconstruct it?
If there's a better way to structure my checkboxes to begin with, that would be an acceptable alternative.