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

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -