SyntaxFix
Write A Post
Hire A Developer
Questions
You can also use math function to do this
var i = 0; $('#button').on('click', function() { if (i++ % 2 == 0) { $(this).val("Push me!"); } else { $(this).val("Don't push me!"); } });
DEMO