JavaScript 参考手册
Style listStyle 属性
更改列表的样式
源代码:
点击运行 »
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>蜜蜂教程(mifengjc.com)</title> <script> function displayResult() { document.getElementById("ul1").style.listStyle = "decimal inside"; } </script> </head> <body> <ul id="ul1"> <li>Coffee</li> <li>Tea</li> <li>Water</li> <li>Soda</li> </ul> <br> <button type="button" onclick="displayResult()">修改列表style</button> </body> </html>
运行结果:
点击运行 »