$(function() { $("input[name='chkPinNo']").click(function() { if ($("#chkYes").is(":checked")) { $("#dvPinNo").show(); } else { $("#dvPinNo").hide(); } }); });
<div>Do you have Pin No?</div> <label for="chkYes"> <input type="radio" id="chkYes" name="chkPinNo" /> Yes </label> <label for="chkNo"> <input type="radio" id="chkNo" name="chkPinNo" /> No </label> <hr> <div id="dvPinNo" style="display: none"> Pin No: <input type="text" id="txtPinNo" /> </div>
hr { display: block; margin-top: 0.5em; margin-bottom: 0.5em; margin-left: auto; margin-right: auto; border-style: inset; border-width: 1px; }