Hello, I have a couple of CSS files and i want to make it so i can choose from them http://ads.domain.tld/ninja.css http://ads.domain.tld/highscore.jss http://ads.domain.tld/planets.css http://ads.domain.tld/basic.css how can i make it so saying i click "Ninja" it will use "http://ads.domain.tld/ninja.css" etc....
Something like this? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <link rel="stylesheet" type="text/css" href="1.css" /> <style type"text/css"> #wrapper{ width: 100px; height: 100px; margin: 0px auto; background-color: cyan; } </style> <script type="text/javascript"> function changef(a){ var b = document.getElementsByTagName("link")[0]; if (b.rel == "stylesheet"){ b.href = a; } } </script> </head> <body> <div id="wrapper" class="class1"> hello dolly <input type="button" value="1.css" onclick="changef(this.value)"> <input type="button" value="2.css" onclick="changef(this.value)"> <input type="button" value="3.css" onclick="changef(this.value)"> </div> </body> </html> HTML: where 1.css contains: .class1{ color:red; } Code (markup): and 2.css contains: .class1{ color:green; } Code (markup): & so on..