Saturday, 31 August 2013

Toggle Button value

Toggle Button value

I have this code which hides/shows the div on button click. Is there any
way I can toggle the button value?
<div>
<button id="showmenu" type="button">Click Me!</button>
</div>
<div class="menu" style="display: none;">
Can the button value change to "show" or "hide"
</div>
<script>
$(document).ready(function() {
$('#showmenu').click(function() {
$('.menu').toggle("slide");
});
});
</script>

No comments:

Post a Comment