Latest web development tutorials

HTML DOM Style listStyleImage property

Style Object Reference Style Objects

Definition and Usage

listStyleImage property sets or returns a list of items marked images.

grammar

Setting listStyleImage properties:

Object.style.listStyleImage="none|url|inherit"

Back listStyleImage properties:

Object.style.listStyleImage

描述
none 默认。无图像显示。
url 规定图像的路径。
inherit listStyleImage 属性的值从父元素继承。


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support listStyleImage property.

Note: IE7 and earlier versions do not support the "inherit" value.IE8 only provides! DOCTYPE supported "inherit". IE9 support "inherit".


Examples

Examples

Change list items marked list:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>本教程(w3big.com)</title>
<script>
function displayResult(){
    document.getElementById("ul1").style.listStyleImage="url('sqorange.gif')";
}
</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()">修改列表项标记</button>

</body>
</html>

try it"


Style Object Reference Style Objects