We would like to know how to fade button text when clicking.
<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
src='http://code.jquery.com/jquery-1.8.3.js'></script>
<script type='text/javascript'>
$(window).load(function(){<!--from w w w.ja v a 2 s .c o m-->
$('#slideButton').click(function()
{
$(this).find('span').html('Collapse').hide().fadeIn('slow');
});
});
</script>
</head>
<body>
<button id="slideButton" type="button">
<span>Expand</span>
</button>
</body>
</html>
The code above is rendered as follows: