
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
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
How to set the type of cursor to display for the mouse pointer with JavaScript?
To set the type of cursor, use the cursor property in JavaScript. It allows you to change the cursor on button click.
Example
You can try to run the following code to set the type of cursor to display for the mouse pointer with JavaScript −
<!DOCTYPE html> <html> <body> <h1 id="myID">Heading 1</h1> <p>Check the heading before and after mouse hover.</p> <button type="button" onclick="display()">Click to change the cursor</button> <script> function display() { document.getElementById("myID").style.cursor = "pointer"; } </script> </body> </html>
- Related Questions & Answers
- How to set the type of quotation marks for embedded quotations with JavaScript?
- How to set the cursor to wait in JavaScript?
- How to change the mouse pointer color in Tkinter?
- How to find the coordinates of the cursor with JavaScript?
- How to set the type of positioning method used for an element with JavaScript?
- Changing the Mouse Cursor in Tkinter
- How to set an element's display type with JavaScript?
- How to hide or disable the mouse pointer in Tkinter?
- How to set the list-item marker type with JavaScript?
- How to find the coordinates of the cursor relative to the screen with JavaScript?
- Zoom HTML5 Canvas to Mouse Cursor
- Display message when hovering over something with mouse cursor in Tkinter Python
- How to set the type of line in a text-decoration with JavaScript?
- How to set the font family for text with JavaScript?
- How to set the boldness of the font with JavaScript?
Advertisements