javascript當中l(wèi)ink 的alternate stylesheet 用法

例 6.4:linkChangeCssFileIEFF.html
馬克- to-win:馬克 java社區(qū):防盜版實名手機尾號: 73203。
馬克-to--win:切換css文件:document.getElementsByTagName("link");


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <TITLE> New Document </TITLE>
    <!--
    馬克-to-win: here the idea is that for the whole page, sometimes, we use this css, sometimes, we use that css,
    with this method, we can switch. with this method, we can switch skin.
    "alternate stylesheet"是備用樣式。
     -->
    <link rel="alternate stylesheet" href="a.css" type="text/css" title="red" />
    <link rel="stylesheet" href="b.css" type="text/css" title="green" />
    <link rel="alternate stylesheet" href="c.css" type="text/css" title="blue" />
    <script language="javascript">
        function setActiveStyleSheet(t)
        {
            var links = document.getElementsByTagName("link");
links[0].disabled=false;
links[1].disabled=true;
links[2].disabled=true;
 alert(links[0].disabled+""+links[1].disabled+links[1].getAttribute("title")+links[2].getAttribute("href"));


        }

    </script>
</HEAD>
<body>

<select id="" onChange=" setActiveStyleSheet(this)">
    <option id="" value="red" >紅</option>
    <option id="" value="green" >綠</option>
    <option id="" value="blue">藍</option>

</select>


</body>
</HTML>