Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
How to set an image as the list-item marker with JavaScript?
To set an image as the marker in list-item, use the listStyleImage property in JavaScript.
Example
You can try to run the following code to set an image as the list-item marker with JavaScript −
<!DOCTYPE html>
<html>
<body>
<ol id="myID">
<li>One</li>
<li>Two</li>
</ol>
<button type="button" onclick="display()">Update list image</button>
<script>
function display() {
document.getElementById("myID").style.listStyleImage = "url('http://tutorialspoint.com/css/images/bullet.gif')";
}
</script>
</body>
</html> Advertisements
