改一下:Javascript能把它本身用的CSS文件内的一个背景颜色数值放到它的一个变量中吗?急急急????
解决方案 »
- 有做支持tif格式Web图片浏览器
- 通过js函数是否能改变某一标签的动作函数?
- 在线等一分析思路
- 还是老的输入框赋值的问题到现在还没解决
- Ext 2.0 editorgrid 如何锁定第一列?请高手帮忙。
- 请教一个Ext4页面的问题,请大神赐教
- flash显示问题 . . .
- 请问这条语句错在哪里?
- 特急求助:在WEB控制程序开发中,客户端是用JavaScript还是用JAVA小程序好?
- 菜鸟求助 JS 调试 “value”未定义 我该怎么写????
- document.write (7*6.6) 输出的结果怎么是46.199999999999996 ??
- help:Netscape恨事!我不知道为什么我现在如此讨厌Netscape!还请高人指点!
是不是先指定一个对象使用这个class然后读这个对象的style?
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
<link rel="stylesheet" href="bb.css">
<SCRIPT LANGUAGE="JavaScript">
<!--
var statusarea;
function syzone (a){
statusarea = a;
a.style.backgroundColor="#99ccff";
}
function syztwo(a){
statusarea = a;
a.style.backgroundColor="#e0e0e0"
}
-->
</script>
</head>
<body>
<table border="1" width="100%">
<tr>
<td width="100%" class="color1" onmouseover="syztwo(this)" onmouseout="syzone(this)" > </td>
</tr>
</table>
</body>
</html>
这是bb.css
.color1 {background:#99ccff}
.color2 {background:#e0e0e0}
我想把html文件的所有颜色去掉,所有的颜色的都留在CSS文件中。
a.style.backgroundColor="#99ccff";--> a.className = color1;
a.style.backgroundColor="#e0e0e0";--> a.className = color2