Javascript examples for CSS Style Property:listStyleImage
The listStyleImage property sets or gets an image as the list-item marker.
Value | Description |
---|---|
none | No image is used. Default |
url | Specifies the path to the image |
initial | Sets this property to its default value. |
inherit | Inherits this property from its parent element. |
Item | Value |
---|---|
Default Value: | none |
Return Value: | A String, representing the location path of the image |
CSS Version | CSS1 |
Specify an image as the list-item marker in a list:
<!DOCTYPE html> <html> <body> <ul id="myList" style="list-style-image:url('http://java2s.com/resources/c.png');"> <li>Coffee</li> <li>Tea</li> <li>Water</li> <li>Soda</li> </ul>/*from www .j ava2s. com*/ <button type="button" onclick="myFunction()">Test</button> <script> function myFunction() { document.getElementById("myList").style.listStyleImage = 'http://java2s.com/resources/a.png'; } </script> </body> </html>