有前端按钮控件btn1,假定宽度为100,如果填充比例设为20,填充颜色设为红色,那么,按钮背景红色占据20,原有颜色占用80,这段代码该怎么实现?
解决方案 »
- Permission denied to access property 'document'
- json 从前台传到后台,然后再传到前台时读不出中文。
- 怎么实现 在页面动态弹出一个DIV提示层然后动态消失(带效果图)
- 想实现当前页面分类刷新,怎么弄
- 是不是disabled以后字体颜色就不能改变了?(默认是灰色)
- web上能不能实现鼠标拖拉事件
- 关于html与javascript的问题
- 帮忙了··!急的内裤都套头了!求简单脚本!(吐血)
- 每10秒钟自动提交一次表单,请问这个功能是怎样实现的
- 特急!!!!!小M求救
- FCKeditor里粘贴word的表格,显示乱码
- DwrUserBean找不到,请高手指点
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>无标题文档</title>
<style>*{margin:0; padding:0;}</style>
</head>
<body>
<div style="width:100px; height:200px; background:#090;"><div id="s" style=" width:20%; height:200px;"></div></div>
<input type="button" id="btn" value="click me" />
<script>
document.getElementById('btn').onclick = function(){
document.getElementById('s').style.background = 'red';
};
</script>
</body>
</html>