Sunday 15 September 2013

php - javascript: value increase continuously -


I knew that this is just a simple problem but I still can not fix it. What do I want to do when I click on the button, and here is my code, the value of the output will increase continuously:

  $ ('. Submit') Live ('vclick', function () {var X = 0; x + = 1; document. GetElementById ('plus'). InnerHTML = x;});   

Thanks in advance

Better to store jQuery.data Use some variable DOM elements at

  $ (document). ('Vclick', '.submit', function () {var el = $ ('# plus'); var x = $ (L). Data ('X') | 0; LLL (++ X); $ (this) .data ('x', x);});    

No comments:

Post a Comment