html - Jquery how to hide form on submit and show a link to show the form again -
i new jquery , here thing want ask. below html code,
<div> <!-- div 1 --> <div class="search_tag"> <span>show search from</span> </div> <!-- div 2 --> <div class="search"> <form> ...... <input class="submit" type="submit" value="submit" /> </form> </div> </div>
now, when page loads, want div 2 i.e <div class="search">
shown , div 1 i.e <div class="search_tag>
hide. when click on form submit, page refresh , want form hide i.e <div class="search">
, <div class="search_tag">
show up. when click on div 1 i.e <div class="search_tag">
want div 2 i.e <div class="search">
form show , make form submission. need jquery.
important note : i don't need form button event, need form submit event page refresh.
<span id="togglesearch"></span> <input id="submit" class="submit" type="button" value="submit" /> $('#togglesearch').onclick(function() { $('.search').toggle(); $('.search_tag').toggle(); }); $('#submit').onclick(function() { $('.search').toggle(); $('.search_tag').toggle(); });
Comments
Post a Comment