0PricingLogin
jQuery Academy · Lesson

JQuery and Animations

JQuery and Animations

Introduction

Hello,

In this section, we will learn animation with jQuery.

Let's get started.

show - hide method

show() and hide() methods

We can show and hide a DOM object on the screen with the show and hide methods.

<h1 id="target">Hello Coddy</h1>	
<button id="show">Show</button>	
<button id="hide">Hide</button>	

<script>
/*
hide method hides target 
element from DOM.
*/
$('#hide').on('click', function(){
   $('#target').hide();
})

/*
show method shows the 
target element in the DOM.
*/
$('#show').on('click', function(){
  $('#target').show();
});

</script>
← Back to jQuery Academy