html - How do I make a Jquery loop of code repeat -


I am trying to create a button that makes the background color white to yellow, and when the button is again Clicks it white turns back, I'm using Jquery to achieve it, but I'm running into a problem while doing a loop function. I have the installation of JSFDial with a similar code that I have here below.

----- HTML -----

  & lt; Html & gt; & Lt; Top & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Div class = "button" & gt; & Lt; / Div & gt; & Lt; / Body & gt; & Lt; / Html & gt;  

---- CSS ----

 . Button {background-color: # 00ccff; Width: 250px; Height: 250px; Limit-Radius: 25%; Left: 0 pixels; Correct: 0 pixels; Margin-left: auto; Margin-right: auto; Margin-Top: 5 AM; } .body {background color: white; }  

---- JQUERY ----

  $ (document) .ready (function () {var click = false; (function loop Click ($ ('' button ''). {$ ('Button') (function () {$ ('body'). CSS ("background color", "yellow"); click = true; (" Background "," white "); click = false;});}}) Click on (function :) {$ ('body'). ();});  

  $ (document) .ready (function () {var click = Click the css ("background color", "yellow"); click = true;} and (click =) is incorrect; $ ('.button') (function () {if (click == false) {$ ( 'Body'). {$ ('Body'). CSS ("background-color", "white"); click = false;}});});  

Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -