How to display the div on click radio button yes or not used javascript

HTML, PHP 0 Comments
onclick radio button show show div

How to display the div on click radio button yes or not used javascript
onclick hide and show the div box on click radio button

Expalin how to show div onclick radio button
document.getElementById(‘yesCheck2’).checked)

Function of this code is pass the id name same in input tag type “yesCheck2″

for example element id=”yesCheck2″

Daily Visit GK on myshort.in

<input type=”radio” onclick=”javascript:yesnoCheck4();” name=”yesno” id=”yesCheck2″>

Function of this code Onclick show div by id and style=”display:none”

document.getElementById(‘ifYes2’).style.display = ‘block’;
<div id=”ifYes2″ style=”display:none”> </div>

Javascript Code 

<script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script>
 <script type="text/javascript">

function yesnoCheck4() {
 if (document.getElementById('yesCheck2').checked) {
 document.getElementById('ifYes2').style.display = 'block';
 }
 else document.getElementById('ifYes2').style.display = 'none';

}

function yesnoCheck2() {
 if (document.getElementById('yesCheck1').checked) {
 document.getElementById('ifYes1').style.display = 'block';
 }
 else document.getElementById('ifYes1').style.display = 'none';

}

</script>

 

HTML Code 

Yes <input type="radio" onclick="javascript:yesnoCheck4();" name="yesno" id="yesCheck2">
 No <input type="radio" onclick="javascript:yesnoCheck4();" name="yesno" id="noCheck2"><br>
 <div id="ifYes2" style="display:none">
 Open the input box in div on click radio button <input type='text' id='yes' name='yes'><br>
 Open the input box in div on click radio button <input type='text' id='acc' name='acc'>
 </div>

Yes <input type="radio" onclick="javascript:yesnoCheck2();" name="yesno1" id="yesCheck1">
 No <input type="radio" onclick="javascript:yesnoCheck2();" name="yesno1" id="noCheck1"><br>
 <div id="ifYes1" style="display:none">
 Open the 2nd input box in div on click radio button <input type='text' id='yes' name='yes1'><br>
 Open the 2nd input box in div on click radio button <input type='text' id='acc' name='acc1'>
 </div>

 

onclick radio button show show div
onclick radio button show show div

 

 

 

Buy online Rajasthan gk book Railway JE CBT REET PAtwari Book SSC CGL Clerk GD Book Buy online Rajasthan gk book Railway JE CBT REET PAtwari Book SSC CGL Clerk GD Book

share..Share on Facebook0Share on Google+0Tweet about this on TwitterShare on LinkedIn0