Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript JQuery variable to CSS? Reply To: JQuery variable to CSS?

#148804
TheDoc
Member

The css() function styles a particular element that you’ve selected. It all depends on how you want the styles to work.

If you want users to be able to put in any styles like:

.test {
    background: blue;
}

Then you’ll need to do something like this:

$("#sb").append('<style>'+sourceC+'</style>');