HTML已创建,但style = null
HTML created but style = null
我在星系标签上运行我的脚本。我有一个奇怪的问题,我创建了一个HTML元素(div),一旦我尝试访问style属性,我有一个错误消息告诉我,style是空的。下面是我的代码:
var DIVOU = document.createElement('div');
console.log('Style DIVOU '+DIVOU.style);
日志信息:"06-12 13:19:08.530: D/Javascript Log(18668): Log Style DIVOU null"如果你有任何想法,请提前感谢。
你没有任何与它相关的样式!
先添加一些样式,然后记录!
好的,问题是html文件没有内容类型的元标记。Android的常规浏览器似乎无法正确读取html文件。
相关文章:
- 数组在递归方法中设置为null
- javascript无法读取属性'style'为null
- 无法在Chrome的Javascript控制台中读取null的属性“style”
- JavaScript TypeError:无法读取 null 的属性“style”
- 未捕获的类型错误:无法读取属性'style'为null
- 如何修复未捕获的类型错误:无法读取属性'style'为null
- 未捕获的类型错误:无法读取属性'style'为null
- 0.style为null或不是aobject
- HTML已创建,但style = null
- 未捕获的TypeError: Cannot read property 'style'null - JS
- TypeError: Cannot read property 'style' of null (Jav
- Webview:无法读取property 'style'null +意外标识符
- 未捕获类型错误:无法读取属性'style'null"
- TypeError: null不是对象(计算'document.getElementById(x).style&
- 不能读取属性'style'动态HTML代码中的null
- 未捕获的类型错误:无法读取属性'style'为null
- 道场'TypeError:无法读取属性'style'为null的'发送xhrPost请求
- Simon.js:未捕获类型错误:无法读取属性'style'为null
- JS 类型错误:无法读取 null 的属性“style”
- TypeError: Cannot read property 'style' of null in j