最赞回答 / Kevinke
同学mychar是一个html element,mychar.innerHTML是获取这个element的内部html内容,这里是一个字符串(hello world),你用document.write输出的内容用加号连接,意思是输出一个字符串,不用innerHTML的话,输出的内容是:原标题:[object],而不是:原标题: hello world. 自己在浏览器里边试试就知道了。
2015-04-20
已采纳回答 / Perona
background 属性在一个声明中设置所有的背景属性。Object.style.background=background-color background-imagebackground-repeat background-attachment background-position也就是说如果用background可以同时设置多个背景属性。不通过是可能是因为这里只验证有没有backgroundColor。
2015-04-20