Topic: show hidden div when select option is selected

juderaj free asked 7 years ago

So what I want, I have a drop down list (select with a number of options). When a certain option is selected I want a hidden div to display. <script> $(function() { $('#row_dim').hide(); $('#type').change(function(){ if($('#type').val() == 'parcel') { $('#row_dim').show(); } else { $('#row_dim').hide(); } }); }); </script> <div class="row"> Type <select class="mdb-select" name="type" id="type" style="margin-left:57px; width:153px;"> <option ame="l_letter" value="l_letter">Large Letter</option> <option name="letter" value="letter">Letter</option> <option name="parcel" value="parcel">Parcel</option> </select> </div> <div class="row" id="row_dim"> Dimensions <input type="text" name="length" class="dimension" placeholder="Length"> <input type="text" name="width" class="dimension" placeholder="Width"> <input type="text" name="height" class="dimension" placeholder="Height"> </div>

Please insert min. 20 characters.


Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.


Specification of the issue

  • User: Free
  • Premium support: No
  • Technology: General Bootstrap questions
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No