html - Prevent second button click using jQuery -
I have a button on my page. I do not want to do any operation if the user clicks on the button for the second time. I have the following code but it is not working. (Can anyone help ??)
$ ("# myButton"). Click (function () {var count = 0; count ++; warning ("button"); if (calculation> 1) $ ('#mybutton') .prop ('disabled', true);}) ; & Lt; Button type = "button" id = "mybutton" & gt; Me & lt; / Button & gt; Click
You can use it in jquery
$ ("# myButton"). A ("click", function () { will attach a handler to an event for this element which will be executed on most.
Comments
Post a Comment