|
function setstyle(stylename)
{
var sheet
for(var loopIndex=0;loopIndex<document.stylesheets.length;loopIndex++)
{
sheet=document.stylesheets[loopIndex]
sheet.disabled=true
if(sheet.id==stylesheets)
{
sheet.disabled=false
}
}
}
<Added>
my code is not wrong i suppose but its not working if any body can help me plz .
<style id = dramatic>
body{font-family:vardana;color:red;background-color:green}
</style>
<style id = normal disabled=true>
body{font-family:times new roman ;color=green;background-color;red}
</style>
i made these to styles which i am using .
<input type="button" value="change color normal" onclick="setstyle('normal')">
<input type="button" value="change color dramatic" onclick="setstyle('dramatic')">
and calling them this way and a text written in body tag but the background nor the text font changes when i click any of these buttons.
|
|
|
|
|
|
|
|