Javascript examples for CSS Style Property:listStyle
The listStyle property sets or gets three separate list properties in a shorthand form.
Parameter | Description |
---|---|
type | list-item marker type |
position | Positions the list-item marker |
image | an image to be used as the list-item marker |
initial | Sets this property to its default value. |
inherit | Inherits this property from its parent element. |
Item | Value |
---|---|
Default Value: | disc outside none |
Return Value: | A String, representing the style of a list |
CSS Version | CSS1 |
Get the style of a list:
<!DOCTYPE html> <html> <body> <ul id="myList" style="list-style-type:circle;"> <li>Coffee</li> <li>Tea</li> <li>Water</li> <li>Soda</li> </ul>/*from w ww . ja va2 s. c om*/ <button type="button" onclick="myFunction()">Return list-item marker type</button> <script> function myFunction() { console.log(document.getElementById("myList").style.listStyleType); } </script> </body> </html>