|
|
||||
首页
文学作品 网页设计 平面设计 程序设计 考试认证 基础办公 QQ资源 服务器架设 网站运营 网页资源
|
|
|
| 汉南在线 → 网页设计 → HTML/CSS | |||||||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>无标题文档</title> <style type="text/css"> <!-- #test1{ width:50%; margin:0px auto; padding:5px; } .border1{ background:#ADE9AE ; border:dotted 1px #ff0000; } .border2{ background:#ffffff; border:solid 1px #00ff00; } --> </style> <script type="text/javascript"> function changeColor(){ var test; test=document.getElementById("test1"); test.onmouseover=function(){ test.className='border1'; } test.onmouseout=function(){ test.className='border2'; } } window.onload=changeColor; </script> </head> <body> <div id="test1" class="border2"> getElementById(参数)---根据页面项目的id,取得该对象,对象是唯一的。getElementsByName(参数)---根据页面项目的名字,取得对象集合。 </div> </body> </html> <a href="http://js.alixixi.com/">欢迎访问阿里西西网页特效代码站,js.alixixi.com</a>
| |||||||||||
| >> 相关文章 | |||||||||||
|
授权使用:汉南在线 http://hnzx.hzwz.net/ 经营许可证:陕ICP备05000109号 Powered by:汉南在线 Copyright (c) 2002-2008 汉南在线. All Rights Reserved . |