"show a hidden div when a select option"
Bootstrap 4.1.1 Snippet by mohamedalbrolosy5

<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="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> <script src="https://code.jquery.com/jquery-1.12.4.js"></script> <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> <div class="opt-sel"> <select onchange="displayDivDemo('hideValuesOnSelect', this)"> <option value="0">Java</option> <option value="1">Javascript</option> </select> <select id="hideValuesOnSelect"> <option value="0">Java</option> <option value="1">Javascript</option> </select> </div>
.opt-sel { text-align:center; margin:50px; } select{ width:30%; } #hideValuesOnSelect { display: none; margin:0 auto; margin-top:10px; }
function displayDivDemo(id, elementValue) { document.getElementById(id).style.display = elementValue.value == 1 ? 'block' : 'none'; }

Related: See More


Questions / Comments: