- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to set the position of the list-item marker with JavaScript?
To set the position of the marker of the list-item, use the listStylePosition property. You can try to run the following code to set the position of the list-item marker with JavaScript −
Example
<!DOCTYPE html> <html> <body> <ol id="myID"> <li>One</li> <li>Two</li> </ol> <button type="button" onclick="displayInside()">Add list inside</button> <button type="button" onclick="displayOutside()">Add list outside</button> <script> function displayInside() { document.getElementById("myID").style.listStylePosition = "inside"; } function displayOutside() { document.getElementById("myID").style.listStylePosition = "outside"; } </script> </body> </html>
Advertisements