argumentsStyle
2018-10-08 本文已影响0人
Jadon7
<!DOCTYPE html>
<html>
<head>
<title>argumentsStyle</title>
</head>
<script type="text/javascript">
function iStyle(obj,name,value)
{
if (arguments.length==2) {
alert(obj.style[name]);
}
else
{
obj.style[name]=value;
}
}
window.onload=function()
{
var oDiv=document.getElementById('div1');
// iStyle(oDiv,'width','300px');
}
</script>
<body>
<div id="div1" style="width: 100px; height: 100px; background-color: green"></div>
</body>
</html>