I learned that function toggle() is deprecated. So what can i use instead toggle for this example:
<div id="block" style="width: 200px; height: 150px; background-color: blue"></div>
<span id="click">hide</span>
$("#click").toggle(
function(){
$("#block").slideUp();
$(this).html('show');
},
function(){
$("#block").slideDown();
$(this).html('hide');
});