SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Sep 2005
    Posts
    189
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problems changing css class

    Hi,

    I posted over in the css thread but I'm now thinking it may be a JS problem, so I hope it's okay to link to it here:

    http://www.sitepoint.com/forums/showthread.php?t=443665

    Basically I'm changing the class of an element in javascript but It's obviously not changing because there is no change on the screen.

    Thanks

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    16,420
    Mentioned
    160 Post(s)
    Tagged
    1 Thread(s)

    changing CSS with javascript

    Have you tried using setAttribute ?

  3. #3
    SitePoint Guru
    Join Date
    Apr 2006
    Posts
    802
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you are using html and IE is the problem child, set the className
    attribute directly: element.className='newClass';


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
  •