W3Schools.com

Style listStyleImage Property

Style Object Reference Style Object

Definition and Usage

The listStyleImage property sets or returns an image as the list-item marker.

Syntax

Set the listStyleImage property:

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

Return the listStyleImage property:

Object.style.listStyleImage

Value Description
none No image will be displayed. This is default
url Specifies the path to the image
inherit The value of the listStyleImage property is inherited from parent element


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The listStyleImage property is supported in all major browsers.


Example

Example

Change the list-item marker of a list:

<html>
<head>
<script type="text/javascript">
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()">Change list-item marker</button>

</body>
</html>

Try it yourself »


Style Object Reference Style Object
WEB HOSTING
Best Web Hosting
PHP MySQL Hosting
Best Hosting Coupons
UK Reseller Hosting
Cloud Hosting
Top Web Hosting
$7.95/mo SEO Hosting
Premium Website Design
WEB BUILDING
Download XML Editor
FREE Website BUILDER
Free Website Templates Free CSS Templates
Make Your Own Website
W3SCHOOLS EXAMS
Get Certified in:
HTML, CSS, JavaScript, XML, PHP, and ASP
W3SCHOOLS BOOKS
New Books:
HTML, CSS
JavaScript, and Ajax
STATISTICS
Browser Statistics
Browser OS
Browser Display
SHARE THIS PAGE