Simple jQuery variable

Here is an example:

1
2
3
4
$(document).ready(function(){
    var color = "red";
    $("body").css("background-color", color);
});

This will take the color red and assign it as body background color.

ADD A COMMENT: