Skip to content

Instantly share code, notes, and snippets.

@jackabox
Last active December 19, 2015 10:19
Show Gist options
  • Save jackabox/5939572 to your computer and use it in GitHub Desktop.
Save jackabox/5939572 to your computer and use it in GitHub Desktop.
Using jQuery to Toggle a Search Box
<div id="sarea">
<form id="searchform" action="<php echo home_url( '/' ); >" method="get" role="search">
<input id="s" type="text" name="s" value="" placeholder="Search Here & Hit Enter">
</form>
</div>
<a href="#" id="sbutton"> Search </a>
$("#sbutton").click(function () {
$('#sarea').toggle();
});
#sarea {
visibility: hidden;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment