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

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -