I have this code inside my body - I'd like to show the input box only when the checkbox is checked, and then disappear again once unchecked.
<input type="checkbox" name="exercheckbox">THISCHECKBOX
<!-- show this input box --> <input type="text" name="reps">
You can also do with a pure CSS Solution like this.
<input type="checkbox" name="exercheckbox" id="exercheckbox">THISCHECKBOX</input>
<input type="text" name="reps" id="reps" />
CSS:
#reps{
display: none;
}
#exercheckbox:checked ~ #reps{
display: block;
}