<link rel="stylesheet" href="a.css" id="css">
<input type=checkbox onclick="GetCSS(this)">
<script>
function GetCSS(o)
{
if(o.checked)
document.getElementById("css").href="b.css"
else
document.getElementById("css").href="a.css"
}
</script>a.css
===========
body{
background:red
}b.css
==========
body{
background:blue
}
<input type=checkbox onclick="GetCSS(this)">
<script>
function GetCSS(o)
{
if(o.checked)
document.getElementById("css").href="b.css"
else
document.getElementById("css").href="a.css"
}
</script>a.css
===========
body{
background:red
}b.css
==========
body{
background:blue
}
解决方案 »
- 关于javascript对象的问题
- 大家看一下,这个面板如何实现的。
- 关于超链接传值的问题
- fireEvent参数怎么加啊,用fireEvent("onmousedown")产生的event.button为0
- 怎么用JAVASCRIPT做站内搜索啊?
- 如何用图片做一个reset按钮??
- 可不可以循环访问表格(table)中的每一个单元格(td)中的复选框(checkbox)?
- 一个很简单但很急的javascript问题,请指教,谢谢!
- 一个form里有20个checkbox,怎样在提交的时候判断如果选定的超过10个,提示用户
- 在网页上画动态的股票走势图是用JSP还是JAVASCRIPT?
- 新人求教 如何在javascript中更改INPUT中的值
- 如何验证变量名称文本内容?
.aa{background-color:red}
.bb{background-color:blue}
</style>
<input class="aa" type="checkbox" onclick="(this.className=='aa')?this.className='bb':this.className='aa';">
<!--
var cb=document.getElementById("checkbox")
if(cb.check)
document.getElementByTag("text").style.className=“样式一";
else
document.getElementByTag("text").style.className=“样式二";
-->
</script>