开发者

jquery show/hide button and tooltip

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");
    }
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜