I am getting unexpected results with jQuery trying to set the \"click\" method of a div. Please see this jsfiddle. Be sure to open the console window. Click the word a few times
The cleanest solution would be this: http://jsfiddle.net/kannix/fkMf9/4/
$("#test").click(function() { $(this).text(($(this).text() == "Hello") ? "Goodbye" : "Hello"); });