javascript - Jquery change when JS variable changes not working -
I'm trying to make a game where you earn a point when you click on a button Once you When you get the X amount of points, a div appears. I'm tired of using jquery.change to see if the #pointCounter has changed so that it can be detected that by adding a new square it should be visible. It is not working though. Am I not using the change method correctly, or should I use something else? Do checks for changes in workplace rather than change in HTML?
HTML
& lt; P & gt; You have & lt; Span id = 'pointCounter' & gt; 0 to & lt; / Span & gt; Points. & Lt; / P & gt; & Lt; Button id = 'clickbutton' & gt; Click me & lt; / Button & gt; & Lt; Div id = 'store' & gt; & Lt; / Div & gt; Click (function () {points = points + addPoints; $ ( '# pointcounter')) JS
$ ( '# clickbutton') . Html (digits);}); $ ('#bindootenter') Change (function () {if (numerals> = 5) {$ ('# store'). AddClass ('showMe');}}); It is not possible to display div at this point: <$
< ('Showme'), $ ('showme'); $ ('Showme'); Click on $ ( 'showme') to (function () {points = points + addPoints; if (point & gt; 500) $ ( '# someDIV' #pointCounter '). Html (points);});
Comments
Post a Comment