js动态调用css样式表哪里出错了_html/css_WEB-ITnose

WBOY
Release: 2016-06-21 09:31:57
Original
1084 people have browsed it

Copy after login
nbsp;html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">



2列固定宽度左窄右宽型+头部+尾部
 


<script> <br /> function change(a){ <br /> var css=document.getElementByIdx("cssid"); <br /> if (a==1){ <br /> css.setAttribute("href","layout1.css"); <br /> } <br /> if (a==2){ <br /> css.setAttribute("href","layout3.css"); <br /> } <br /> if (a==3){ <br /> css.setAttribute("href","layout.css");} <br /> } <br /> </script>
 我是第一个css1
我是第二个css2
我是第三个css3

  

    头部
  

    
This is the sidebar

    
2列固定宽度左窄右宽型+头部+尾部

  

  
  
This is the footer





回复讨论(解决方案)

var css=document.getElementByIdx("cssid");
多了一个x

这也太粗心了

是额,这个不应该。

其实我不是学这个滴,但是老师要我写个关于这个的案例给我们班同学看看.....完全是什么也不懂的....不过谢谢你们滴啦...

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template