如何在javascript中编写css代码?(未捕获的TypeError:无法设置undefined的属性"height")
JavaScript的
document.getElementById("slideshow").getElementsByClassName("arrow").style.height = "86px";
Run Code Online (Sandbox Code Playgroud)
CSS
#slideshow .arrow{
height:86px;
width:60px;
position:absolute;
background:url('arrows.png') no-repeat;
top:50%;
margin-top: -43px;
cursor: pointer;
z-index: 5000;
}
Run Code Online (Sandbox Code Playgroud)