style、currentStyle、runtimeStyle区别分析_javascript技巧
来源:动视网
责编:小采
时间:2020-11-27 20:54:28
style、currentStyle、runtimeStyle区别分析_javascript技巧
style、currentStyle、runtimeStyle区别分析_javascript技巧:1、obj.style只能获得内嵌样式(inline Style)就是写在Tag里面的,他访问不到那些链接的外部css和在head中用声明的style。 所以必须认识到在那些使用外部Css文件的页面中,如果用style赋值,如obj.style=color:red;显然效果是正确的,其中
导读style、currentStyle、runtimeStyle区别分析_javascript技巧:1、obj.style只能获得内嵌样式(inline Style)就是写在Tag里面的,他访问不到那些链接的外部css和在head中用声明的style。 所以必须认识到在那些使用外部Css文件的页面中,如果用style赋值,如obj.style=color:red;显然效果是正确的,其中

1、obj.style只能获得内嵌样式(inline Style)就是写在Tag里面的,他访问不到那些链接的外部css和在head中用
1111
alert(document.getElementById("tt").currentStyle.color);
script>