
- Javascript Basics Tutorial
- Javascript - Home
- Javascript - Overview
- Javascript - Syntax
- Javascript - Enabling
- Javascript - Placement
- Javascript - Variables
- Javascript - Operators
- Javascript - If...Else
- Javascript - Switch Case
- Javascript - While Loop
- Javascript - For Loop
- Javascript - For...in
- Javascript - Loop Control
- Javascript - Functions
- Javascript - Events
- Javascript - Cookies
- Javascript - Page Redirect
- Javascript - Dialog Boxes
- Javascript - Void Keyword
- Javascript - Page Printing
- JavaScript Objects
- Javascript - Objects
- Javascript - Number
- Javascript - Boolean
- Javascript - Strings
- Javascript - Arrays
- Javascript - Date
- Javascript - Math
- Javascript - RegExp
- Javascript - HTML DOM
- JavaScript Advanced
- Javascript - Error Handling
- Javascript - Validations
- Javascript - Animation
- Javascript - Multimedia
- Javascript - Debugging
- Javascript - Image Map
- Javascript - Browsers
- JavaScript Useful Resources
- Javascript - Questions And Answers
- Javascript - Quick Guide
- Javascript - Functions
- Javascript - Resources
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>
- Related Articles
- How to set the list-item marker type with JavaScript?
- How to set the position of the list-item marker with JavaScript?
- How to add an image as the list-item marker in a list using CSS?
- How to set the image to be used as a border with JavaScript?
- How to set the brightness and contrast of an image with JavaScript?
- Set how the item will shrink relative to the rest with JavaScript?
- How to set the initial length of a flexible item with JavaScript?
- How to set the length of the item relative to the rest with JavaScript?
- How to set the order of the flexible item, relative to the rest with JavaScript?
- How to set the widths of the image border with JavaScript?
- How to set the size of the background image with JavaScript?
- Set the distance between the marker and the text relating to that marker with CSS
- How to preselect a list item using JavaScript?
- How to set the inward offsets of the image border with JavaScript?
- How to set the positioning area of the background image with JavaScript?

Advertisements