
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Set Image as 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