How do I change a CSS style using a query string

Discussion in 'JavaScript' started by jim28100, Oct 10, 2006.

  1. #1
    Can anyone tell me how to change the name of an on-page CSS style using a 'query string' on the end of a URL.

    This is the CSS that's in the <HEAD> of each page.

    <style type="text/css">
    #link1 {
    background-color: #D7EBB0;
    }
    </style>


    I need to change ID name '#link1' to '#link2', '#link3' etc.

    Any ideas?

    Jim
     
    jim28100, Oct 10, 2006 IP
  2. penagate

    penagate Guest

    Messages:
    277
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Using a server side script.
     
    penagate, Oct 10, 2006 IP
  3. intoex

    intoex Peon

    Messages:
    414
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #3
    you can analize location.href and change style of element using DOM
     
    intoex, Oct 12, 2006 IP
  4. penagate

    penagate Guest

    Messages:
    277
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Yes, but that's an illogical and unreliable way of doing it.
     
    penagate, Oct 12, 2006 IP
  5. intoex

    intoex Peon

    Messages:
    414
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #5
    but what if he has only .html variant? Without server side? ;)
    p.s. true, it's underliable way? but maybe somebody is a maniac :)
     
    intoex, Oct 12, 2006 IP
  6. penagate

    penagate Guest

    Messages:
    277
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    0
    #6
    penagate, Oct 12, 2006 IP