Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Nov 2009
    Posts
    40
    Thanks
    19
    Thanked 0 Times in 0 Posts

    Change CSS Class

    Hi,

    I need to change my class, but this isn't doing it for me and I don't see why. No error messages, but nothing happens.
    Code:
    .myClass {
    	background-color: yellow;
    }
    
    document.getElementById("myId").setAttribute("class","myClass");
    Thank You in Advance for Your Help,

    Lou

  • #2
    New Coder
    Join Date
    Nov 2009
    Posts
    40
    Thanks
    19
    Thanked 0 Times in 0 Posts

    Got it!

    Of course after I post a question I get it working.

    Thanks for having a look at my question.

    Lou

  • #3
    LE1
    LE1 is offline
    New Coder
    Join Date
    Nov 2009
    Posts
    47
    Thanks
    4
    Thanked 1 Time in 1 Post
    Thu=ought css would be better anyway?


  •  

    Posting Permissions

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