Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
90
rated 0 times [  97] [ 7]  / answers: 1 / hits: 11559  / 11 Years ago, mon, december 30, 2013, 12:00:00

HTML



<section id=one>

<form>
<input type=text />
<button id=btn>Go</button>
</form>

</section>

<section id=two >
<h1>Hi</h1>
</section>


I have the above html which has two sections.Im trying to hide the section with id two hide and show section one.When i click on go button,section one should fade and section two should be shown.



Can some one help me code the jquery for this?



Im new to jquery.It would be helpful.



I have a fiddle at http://jsfiddle.net/x8B8c/



please dont ask what I have tried,im a fresher to javascript and html as well,I would like to know how this can be done


More From » jquery

 Answers
8

Try this



HTML



<section id=one>
<input type=text />
<button id=btn>Go</button>
</section>

<section id=two style=display:none>
<h1>Hi</h1>
</section>


JQuery Script



$('#btn').on('click', function(){
$('#one').hide('slow')
$('#two').show('slow');
});


DEMO


[#49141] Saturday, December 28, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
domeniccolti

Total Points: 276
Total Questions: 98
Total Answers: 93

Location: India
Member since Fri, May 13, 2022
2 Years ago
domeniccolti questions
Mon, Oct 18, 21, 00:00, 3 Years ago
Thu, Oct 14, 21, 00:00, 3 Years ago
Thu, Jul 15, 21, 00:00, 3 Years ago
Sat, Oct 24, 20, 00:00, 4 Years ago
Thu, Sep 3, 20, 00:00, 4 Years ago
;