#1
  1. Prom night: 1973
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Dec 2001
    Posts
    1,156
    Rep Power
    25

    Assigning CSS in Javascript


    Could someone tell me how to assign a style sheet to a table row in IE Javascript, please? At the moment I'm trying

    tr.style = document.styleSheets[0];

    but that isn't working.
    Last edited by kurious; December 23rd, 2001 at 10:14 PM.
  2. #2
  3. Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Oct 2001
    Location
    New Zealand
    Posts
    1,774
    Rep Power
    25
    Possibly,

    create a class in the document header style sheet with the attributes you're after, then use

    document.getElementById("element").className = [className]

IMN logo majestic logo threadwatch logo seochat tools logo