How To Pass A Php Variable From A Dropdown To Another Dropdown Using Php? September 09, 2022 Post a Comment ).on("change", function(){ var selectedClass = $(this).val(); //store the selected value $('#select2').val(""); //clear the second dropdown selected value //now loop through the 2nd dropdown, hide the unwanted options $('#select2 option').each(function () { var newValue = $(this).attr('class'); if (selectedClass != newValue && selectedClass != "") { $(this).hide(); } else{$(this).show(); } }); }); });Copy <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script> <select id="select1"> <option value=""></option> <option value="number1">number 1</option> <option value="number2">number 2</option> </select> <select id="select2"> <option class=""></option> <option class="number1">number 1.1</option> <option class="number2">number 2.1</option> <option class="number1">number 1.2</option> <option class="number2">number 2.3</option> <option class="number1">number 1.3</option> <option class="number1">number 1.2</option> </select>Copy Share You may like these postsJquery To Fetch The Contents From A Selected Row In PhpHow To Create A Dotted Shadowy Effect On An Image With Css?Google Recaptcha - Keep Getting `incorrect-captcha-sol`Warning: Session_start(): Cannot Send Session Cookie - Headers Already Sent By (output Started At
Post a Comment for "How To Pass A Php Variable From A Dropdown To Another Dropdown Using Php?"