初步看了一下,好几处错误
1、curreentTab这个变量打错了。
2、getElementByID应为getElementById
3、getElementById中的参数应该用引号引起来
4、<a href="javascript:onclick="changetab('Tab3','Folder3')"">改为
   <a href="#" onclick="changetab('Tab3','Folder3')">我会的也只有这些了。
你先把这几个错误改过来后再慢慢调试吧。

解决方案 »

  1.   

    鼠标称上去事件?
    "><a href=javascript:onMouceover="turnon('cell1')">看看效果</a></td>?
    应是这样吧?
    "><a href=# onmouseover="turnon('cell1')">看看效果</a></td>上面的是点击事件?一样的改法
      

  2.   

    再加多几个地方
    1、 Function改为function
    2、例二中的currentcell.style.backgroundcolor改为currentcell.style.backgroundColor
    3、例二中少了一个“{”
      

  3.   

    谢谢楼上两位, 
    qidizi(qidizi)的问题是我写代码的时候出的问题,后来想起了,谢谢你
    nonamexz(无名小卒)帮忙,我还是搞不清楚为什么不可以用Function
    还有好几个地方你们都说大小写问题,难道JS本身的函数也得区分大小写么?谢谢大家了~
    我再去看看
      

  4.   

    JS区分大小写关于样式表的的属性JS的和CSS的是不一样的写法,http://msdn.microsoft.com/library/
    可以查下相应的属性的写法
      

  5.   

    JS内部定的关键字一定要正确拼写,否则会出错,if是关键字,iF,IF等是自定变量
      

  6.   

    后来我查了一下版本,是不是上面我写的代码不是IE浏览器下的啊.
    是不是JS关键字都是小写?
    谢谢qidizi(qidizi)再次帮忙~
      

  7.   

    不是,所有的浏览器JS跟C一样都要区分大小写的,浏览器的分别只是说明是否支持JS的标准到什么地步而已,也就是有的支持某种东东,而有的不支持,因为这个标准是某个浏览器自己定的,所以你要是担心代码是不是具有通用性,必须使用所有浏览器都支持的标准,而不能使用只是某个浏览器才支持的东东,或是在使用时检测浏览器类型调用相应的页面
      

  8.   

    是不是JS关键字都是小写?
    不是,如你要是用indexof()会出错,因为这不是内定的,只有indexOf()是内定的,
    当你不确定关键字拼写时,最好查下资料,或者测试下--呵,
      

  9.   

    这里的确很好.以后一定常来学习,.呵呵
    谢谢楼上几位了,那个代码我现在搞清楚了..我把代码贴出来.<html>
    <head><title>Tabbed Folders</title>
    <style type="text/css">
    .tab { background-color: #CCCCCC; }
    .tab a { font-family: Verdana, sans-serif; font-size: 11px; 
             font-weight: bold; position: relative; left: 8px; 
             top: 4px; color: #663333}
    .tab a:visited { color: #663333;}
    #Tab1 { background-color: #FFCC99; }.folder { background-color: #CCCCCC; }
    .folder p { font-family: Arial, san-serif; font-size: 12px; 
                margin-top: 10px; margin-right: 25px; margin-bottom: 10px;
                margin-left: 20px}
    .folder h1 { font-family: Arial, san-serif; font-size: 16px; 
                 margin-top: 20px; margin-right: 20px; margin-bottom: 20px;
                 margin-left: 20px}
    #Folder1 { background-color: #FFCC99; }
    </style><script language="JavaScript">
    // State variables to keep track of current tab and folder
    var currentTab = "Tab1";
    var currentFolder = "Folder1";// Function to switch tabs and folders
    function turnOn(newTab, newFolder) {
        if (currentTab != newTab) {
            // Adjust the background colors for the tabs
            var thisTab = document.getElementById(newTab);
            thisTab.style.backgroundColor = "#FFCC99";
            var oldTab = document.getElementById(currentTab);
            oldTab.style.backgroundColor = "#CCCCCC";        // Make the new tab the current tab
            currentTab = newTab;        // Adjust the visibility and background color for the folders
            var thisFolder = document.getElementById(newFolder);
            thisFolder.style.visibility = "visible";
            thisFolder.style.backgroundColor = "#FFCC99";
            var oldFolder = document.getElementById(currentFolder);
            oldFolder.style.visibility = "hidden";        // Make the new folder the current folder
            currentFolder = newFolder;
        }
    }
    </script>
    </head><body bgcolor="#FFFFFF" text="#000000"><!-- Create Tabs -->
    <div id="Tab1" class="tab"
         style="position:absolute; left:20px; top:40px; width:80px; 
                height:20px; z-index:1;">
      <a href="javascript:turnOn('Tab1', 'Folder1');">Inbox</a>
    </div>
    <div id="Tab2" class="tab"
         style="position:absolute; left:100px; top:40px; width:80px; 
                height:20px; z-index:1">
      <a href="javascript:turnOn('Tab2', 'Folder2');">Compose</a>
    </div>
    <div id="Tab3" class="tab"
         style="position:absolute; left:180px; top:40px; width:80px; 
                height:20px; z-index:1">
      <a href="javascript:turnOn('Tab3', 'Folder3');">Addresses</a>
    </div><!-- Create Folders -->
    <div id="Folder1" class="folder"
         style="position:absolute; left:20px; top:60px; width:500px; 
                height:300px; z-index:1; visibility:visible; overflow:auto">
      <h1>Inbox</h1>
      <p>Your inbox contains 20 new messages...</p>
    </div>
    <div id="Folder2" class="folder"
         style="position:absolute; left:20px; top:60px; width:500px; 
                height:300px; z-index:2; visibility:hidden; overflow:auto">
      <h1>Compose</h1>
      <p>Please enter your message here...</p>
      <form>
        <p>To: <input type="text">
        <p>Subject: <input type="text">
        <p><textarea rows="10" cols="40"></textarea>
      </form>
    </div>
    <div id="Folder3" class="folder"
         style="position:absolute; left:20px; top:60px; width:500px; 
                height:300px; z-index:3; visibility:hidden; overflow:auto">
      <h1>Address Book</h1>
      <p>Select an address...</p>
    </div>
    </body>
    </html>