I have some jQuery checkbox buttons, and they work fine. However, I would like to change their text upon a click. for example: the button's text is click me. when the user clicks it, i needs to change to thanks for clicking, for example.
This is what I am trying using:
<script>
$(function() {
$(#button).button();
$(#button).click(function(){
if($(#label).is(':checked')) {
$(#label span).text(Hide);
}
else {
$(#label span).text(Show);
}
});
});
</script>
<input id='button' type='checkbox' />
<label id='label' for=button>Show/Hide</label>