js常用方法,支持所有浏览器操作,可在线浏览
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>js操作元素rgba颜色-webkfa.com</title>
</head>
<body>
<div id="testdivid"
style="background:rgba(11,11,11,0.1);width:50px;height:50px;">
</div>
<br />
<input type="button" value="改变rgba" onclick="op();"/>
<br />
web开发原创文章,更多文章请进<br/>
<a href="http://www.webkfa.com" target="_blank">
http://www.webkfa.com
</a>
<script type="text/javascript">
function op(){
var obj=document.getElementById("testdivid");
obj.style.background='rgba(222,22,222,0.6)';
}
</script>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>js操作元素rgba颜色-webkfa.com</title>
</head>
<body>
<div id="testdivid"
style="background:rgba(11,11,11,0.1);width:50px;height:50px;">
</div>
<br />
<input type="button" value="改变rgba" onclick="op();"/>
<br />
web开发原创文章,更多文章请进<br/>
<a href="http://www.webkfa.com" target="_blank">
http://www.webkfa.com
</a>
<script type="text/javascript">
function op(){
var obj=document.getElementById("testdivid");
obj.style.background='rgba(222,22,222,0.6)';
}
</script>
</body>
</html>