开发者

jquery show/hide button and tooltip

开发者 https://www.devze.com 2023-04-09 12:40 出处:网络
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.

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

精彩评论

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