"div hide and show"
Bootstrap 4.1.1 Snippet by durgesh361

<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <!DOCTYPE html> <html> <head> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script> <style> </style> </head> <body> <div class="container"> <div class="row"> <div class="form-group col-md-3"> <select class="form-control" id="one"> <option>Select Box 1</option> <option value="f1">Click here to go next step</option> <option>3</option> <option>4</option> </select> </div> <div class="form-group col-md-3"> <select class="form-control" id="two" style="display: none;"> <option>Select Box 2</option> <option>1</option> <option value="t1">Click here to go next step</option> <option>3</option> <option>4</option> </select> </div> <div class="form-group col-md-3"> <select class="form-control" id="three" style="display: none;"> <option>3elect Box 3</option> <option>2</option> <option>3</option> <option>4</option> </select> </div> </div> </div> <script> $(document).ready(function(){ $('#one').change(function(){ if($('#one').val()=="f1"){ $('#two').show(); }else{ $('#two').hide(); $('#three').hide(); } }); $('#two').change(function(){ if($("#two").val()=="t1"){ $("#three").show(); }else{ $("#three").hide(); $('#two').hide(); } }); }); </script> </body> </html>
.container{ margin-top:50px; }

Related: See More


Questions / Comments: