Show Hide DIV with TextBox when CheckBox is checked unchecked using jQuery
HTML
<h2>Show Hide DIV with TextBox when CheckBox is checked unchecked using jQuery</h2>
<br />
<br />
<label for="chkPassport2" class="img">
<input type="checkbox" id="chkPassport2" class="img" />
Do you have Passport?
</label>
<br />
<div id="dvPassport2" style="display: none">
Passport Number:
<input type="text" id="Text1" />
</div>
JavaScript
$(function () {
$("#chkPassport2").click(function () {
if ($(this).is(":checked")) {
$("#dvPassport2").show();
} else {
$("#dvPassport2").hide();
}
});
});