问题描述:
[单选]
以下代码中,为<div class="test"></div>设置红色背景的正确js代码为
A.document.getElementsByClassName("test").style.backgroundColor="red";
B.document.getElementsByClassName("test")[0].style.backgroundColor="red";
C.document.getElementsByClassName("test")[0].style.background-color="red";
D.document.getElementsByClassName("test").style.background-color="red";
参考答案:查看无
答案解析:无
☆收藏
答案解析:无
☆收藏
上一篇:<div> <input type="button" id ="button1" value="1" onclick="moveBtn(this);"> <input type="button" id ="button2" value="2" /> </div> <script type="text/javascript"> function moveBtn(obj) { var clone = obj.cloneNode(true); var parent = obj.parentNode; parent.appendChild(clone); parent.removeChild(obj); } </script> 关于上述代码所实现的功能,以下说法正确的是
下一篇:下列哪个不属于id与class之间的区别
- 我要回答: 网友(216.73.216.96)
- 热门题目: 1.Jquery ajax中都支 2.以下哪些属于cookie的属 3.清除浮动的方法有
