你说的参考已经控制了啊
你还想怎么控制
或者如下
<script language= 'javascript'>
aaa.style.cssText="background-color:#FF5533"
</scitpt>
你还想怎么控制
或者如下
<script language= 'javascript'>
aaa.style.cssText="background-color:#FF5533"
</scitpt>
aaa.style.algin= 'left ';
但是span不支持algin属性,他支持text-algin属性
如果我写成
aaa.style.text-algin = 'none ';
就出错了
像这种连字符的都要这么写……
<html>
<head>
<title>test</title>
<script language="javascript">
function show(){
alert(document.getElementById('aaa').style.cssText);
}
</script>
</head>
<form name="myform">
<body>
<span id='aaa' style="text-algin:left">aaaaaaaaaaaaaa</span>
<input type="button" value="show" id="bt" name="bt" onclick="show()">
</body>
</form>
</html>
你还是用div吧