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

Home Forums JavaScript JQuery variable to CSS?

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #148714

    I just started an HTML ‘sandbox’ at and I have some problems with it…

    I converted the CSS which was entered into a textarea element into a variable and tried to use the .css() jQuery function but it does not work unlike the .html() function.

    Please help me out.


    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:


    Thank you very much for your help.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.