asp.net - Need help removing li bullets in Javascript -
i creating ul in javascript , despite efforts cannot seem remove bullets list items. have following javascript:
var btnul = document.createelement("ul"); btnul.id = "btnul"; btnul.style.liststyletype = "none"; document.getelementbyid("leftgutter").appendchild(btnul); document.getelementbyid("btnul").style.liststyle = "none";
and have tried add css #btnul on style sheet list-style-type no luck. doing wrong here?? placed both attempts @ changing style type in javascript demonstrate have tried approaches. have tried them both separately well.
there can 1 reason why list still has bullets. , css rule using !important
to force list-style-type. explains why couldn't remove bullets using css rule.
first fiddle same code using. , works fine. http://jsfiddle.net/5glwbdvr/
second fiddle has css rule force bullets:
ul { list-style-type:disc !important }
http://jsfiddle.net/5glwbdvr/1/
if not reason there must problem in way populating list.
//edit: after seeing how populate list:
you need append list items list , not container.
document.getelementbyid("btnul").appendchild(document.createelement("li"));
Comments
Post a Comment