JQuery changing css background color -
i stared working jquery first time , have simple question changing css, current code able prompt color how can achieved?
$(document).ready(function() { $("#change").click(function() { $("#container").css("background-color", "blue"); }); ive tried this:
<input id="colorinput" type="text"/> $(document).ready(function() { $("#change").click(function() { $("#container").css("background-color", #colorinput); }); and alot of other ways nothing seems work.
change
$("#container").css("background-color", #colorinput); to
$("#colorinput").css("background-color", "#ff0000"); id or class of element effected in selector.
here fiddle.
Comments
Post a Comment