日期:2014-05-16 浏览次数:20451 次
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title> New Document </title> <meta name="Generator" content="EditPlus"> <meta name="Author" content=""> <meta name="Keywords" content=""> <meta name="Description" content=""> <style> ul,li{padding:0;margin:0;list-style:none} #menu li{width:100px;background:#EEE;margin-right:1px;display:block;float:left;height:24px;line-height:24px;vertical-align:middle;text-align:center} #menu li:first-child{background:#CCC;} </style> <script> function MenuClick(obj){ var tag = document.getElementsByTagName("li") for (var i=0;i<tag.length;i++ ) { tag[i].style.background="#EEE" obj.style.background = "#ccc" } } </script> </head> <body> <ul id="menu"> <li onclick="MenuClick(this)">首页</li> <li onclick="MenuClick(this)">页面1</li> <li onclick="MenuClick(this)">页面2</li> <li onclick="MenuClick(this)">页面3</li> <ul> </body> </html>