Last active
October 24, 2017 17:12
-
-
Save thomasbennett/302195bdda5a2509fdb6e0a20968ca56 to your computer and use it in GitHub Desktop.
Show / Hide an element with Bootstrap
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
<script type="text/javascript"> | |
jQuery(document).ready(function() { | |
jQuery('#button-id-here').on('click', function() { | |
jQuery('#form-id-here').toggleClass('hidden'); | |
}); | |
}); | |
</script> | |
<button id="button-id-here">Click Me</button> | |
<form id="form-id-here" class="hidden"> | |
<!-- whatever --> | |
</form> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The ID on the button and the form should match the IDs in the JavaScript.