How do I set a css property with a variable in JQuery?
I need to set the CSS width property to be the same size as the width of the current browser. For this I did var setWidth = $(window).width()
, but I don't know how to apply this to my current code, something like this:
$(document).ready(function(){
$("#backgroundImg").css("width", "");
});
Is there a way to do this? I am new to JQuery so I might be really hobbyist.
+3
source to share
4 answers