SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru Raskolnikov's Avatar
    Join Date
    Jul 2003
    Location
    USA
    Posts
    606
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    inline css with javascript

    hey

    i set the rollover background color for table rows with this code

    Code JavaScript:
    this.style.cursor='hand';this.style.backgroundColor='Khaki'

    but is there a way that instead of specifying the color name, i can get that information from a css stylesheet?

    Thanks
    Ras

  2. #2
    Object Not Found junjun's Avatar
    Join Date
    Mar 2002
    Location
    northern MI
    Posts
    1,392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes swap the CSS class of the element

  3. #3
    SitePoint Guru Raskolnikov's Avatar
    Join Date
    Jul 2003
    Location
    USA
    Posts
    606
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just for future reference of anyone who needs to know.

    Code JavaScript:
    this.className='CSSClassNameHere';

    this seems to work.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •