Demo JQuery .show(), .hide() dan .toggle()

by dshilkret

HTML

<button class="hide">Hide</button>
<button class="show">Show</button>
<button class="both">Both</button>
<div id="target"></div>

CSS

body {padding:30px;}

#target {
  background:white;
  height:160px;
  padding:5px;
}

JavaScript

$('.show').click(function() {
    $('#target').show(500);
});
$('.hide').click(function() {
    $('#target').hide(500);
});
$('.both').click(function() {
    $('#target').toggle('slow');
});