| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 946 人关注过本帖
标题:样式表规则的删除
只看楼主 加入收藏
yqiong
Rank: 1
等 级:新手上路
帖 子:315
专家分:0
注 册:2007-7-4
结帖率:83.33%
收藏
 问题点数:0 回复次数:1 
样式表规则的删除
下面这程序为什么不能删除样式表规则?
<html>
<head>
<title>无标题文档</title>
<style>p.p1{ background-color:#FF0000;font-size:22px;_
font-family:"方正舒体"; font-weight:100; }</style>
<script language="vbscript">
sub remove()
{
document.stylesheets[0].removerule 0
}
end sub
</script></head>
<body><p class=p2 style=" background-color:#FF0000;font-size:22px; font-family:"方正舒体"; font-weight:100;"> hello,this is a example of stylesheets</p>
<form>
<input type="button" value="按我取消下行背景设置" onClick="remove()">
<p class=p1> hello,this is a example of stylesheets</p>
</body>
</html>
搜索更多相关主题的帖子: 删除 样式 规则 
2007-10-14 12:43
yqiong
Rank: 1
等 级:新手上路
帖 子:315
专家分:0
注 册:2007-7-4
收藏
得分:0 
这个也是,实在找不出错误来
<STYLE>
P {color:green;}
</STYLE>
<SCRIPT>
function removeTheRule() {
var iSheets = document.styleSheets.length;
var iRules = document.styleSheets[iSheets-1].rules.length;
if (1 < iRules) {
document.styleSheets[iSheets-1].removeRule(1);
}
}
</SCRIPT>
<P>This text has the new style applied to it.</P>
<BUTTON onclick="removeTheRule()">Remove the new rule.</BUTTON>
2007-10-14 12:44
快速回复:样式表规则的删除
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014237 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved