Changing button text on click using jquery / javascript

Bellow is button for which I want to change button text on click of it.

<input type="button" name="button" value="Text 1" id="btnId" class="btnClass"/>

Bellow is simple jquery which can be used to change text of button on click

$(function(){
$("#btnId").click(function(){
if($("#btnId").val() == "Text 1")
{
$("#btnId").val("Text 2");
return false;
}
else
{
$("#btnId").val("Text 1");
return false;
}
});
});

Demo :

admin