Toggle navigation
Bootsnipp
Bootstrap
For
CSS Frameworks
Bootstrap
Foundation
Semantic UI
Materialize
Pure
Bulma
References
CSS Reference
Tools
Community
Page Builder
Form Builder
Button Builder
Icon Search
Dan's Tools
Diff / Merge
Color Picker
Keyword Tool
Web Fonts
.htaccess Generator
Favicon Generator
Site Speed Test
Snippets
Featured
Tags
By Bootstrap Version
4.1.1
4.0.0
3.3.0
3.2.0
3.1.0
3.0.3
3.0.1
3.0.0
2.3.2
Register
Login
"test cascade answers html"
Bootstrap 3.2.0 Snippet by
dfelippa
3.2.0
jQuery
Preview
HTML
JS
View Full Screen
Fork
Fork this
2.2K
 
0 Fav
Post to Facebook
Tweet this
<link href="//netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container"> <div id="qablock"> <div class="row"> <div class="col-md-6"> <div class="panel panel-primary" id="basepanel1"> <div class="panel-heading"> </div> <div class="panel-body"> <p id="basequestion">question</p> <div class="radio"> <label> <input type="radio" id="a1" name="g1" value="option1">a1 </label> </div> <div class="radio"> <label> <input type="radio" id="a2" name="g1" value="option1">a2 </label> </div> </div> </div> </div> </div> <div id="qablock_for_a1"> <div class="row"> <div class="col-md-6"> <div class="panel panel-primary" id="basepanel1"> <div class="panel-heading"> </div> <div class="panel-body"> <p>question for a1</p> <div class="radio"> <label> <input type="radio" id="a11" name="g2" value="option1">a11 </label> </div> <div class="radio"> <label> <input type="radio" id="a12" name="g2" value="option1">a12 </label> </div> </div> </div> </div> </div> </div> <div id="qablock_for_a2"> <div class="row" name="childqa2"> <div class="col-md-6"> <div class="panel panel-primary" id="basepanel1"> <div class="panel-heading"> </div> <div class="panel-body"> <p>question for a2</p> <div class="radio"> <label> <input type="radio" id="a21" name="g3" value="option1">a21 </label> </div> <div class="radio"> <label> <input type="radio" id="a22" name="g3" value="option1">a22</label> </div> </div> </div> </div> </div> </div> </div> </div>
$(document).ready(function(){ $('input[type="radio"]').click(function(){ $(this).closest("#qablock").children("[id^=qablock_for]").hide() var blockname = "#qablock_for_" + $(this).attr("id"); if ( $(blockname).length ) { $(blockname).show(); } }); });
Related:
See More
Free Template
Material Dashboard
Questions / Comments:
Post
Posting Guidelines
Formatting
- Now
×
Close
Donate
BTC: 12JxYMYi6Vt3mx3hcmP3B2oyFiCSF3FhYT
ETH: 0xCD715b2E3549c54A40e6ecAaFeB82138148a6c76