小编NEW*_*NEW的帖子

如何在javascript中编写css代码?(未捕获的TypeError:无法设置undefined的属性"height")

如何在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)

javascript css

2
推荐指数
1
解决办法
2038
查看次数

标签 统计

css ×1

javascript ×1