I am trying to make a show/hide button 开发者_如何学Cwith jquery and I would also like the tooltip/title to change when the button is hovered over with the mouse but it isn't working at all.
my code can be found here:
http://jsfiddle.net/LYA6q/
HTML:
<input id="button" type='button' value='Not Clicked' title = 'Not Clicked'>
Javascript:
$('#button').click(function() {
if ($(this).val() == "Not Clicked")
{
$(this).val("Clicked");
$(this).attr("title", "Clicked");
}
else
{
$(this).val("Not Clicked");
$(this).attr("title", "Not Clicked");
}
});
精彩评论