Created
October 22, 2022 06:53
-
-
Save msulaimanmisri/c5d86720a92e7e74b785559f0db76501 to your computer and use it in GitHub Desktop.
jQuery show and hide based on <select>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @author Muhamad Sulaiman | |
*/ | |
$("selector").hide(); | |
$(function() { | |
$("selector").change(function() { | |
if ($(this).val() == "value") { | |
$("selector").show(); | |
} else { | |
$("selector").hide(); | |
$("selector").val(''); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment