当前位置:Gxlcms > html代码 > UL赋值问题_html/css_WEB-ITnose

UL赋值问题_html/css_WEB-ITnose

时间:2021-07-01 10:21:17 帮助过:31人阅读





我用document.getElementById("ad").style.marginLeft=cf+"px";可以给DIV赋值。
我现在想给ID为ad下的ul赋值。
document.getElementById("adul").getElementsByTagName("ul").style.marginLeft=cf+"px";
但不行,请问如何给这UL赋值?


回复讨论(解决方案)

document.getElementById("adul").getElementsByTagName("ul") [0].style.marginLeft=cf+"px";

$("#ad>ul").animate({marginLeft: '20px'}, "slow");

document.getElementById("ad").firstChild.style.marginLeft=cf+"px";

人气教程排行