Method 1: Using a CSS class for the links
A CSS class is created that changes the cursor property. The cursor property is used to specify the mouse cursor to be displayed when the mouse is pointed over an element. Using the ‘pointer’ value in this property will change the cursor to a ‘pointer’ indicating a link.
This class can then be used on any link that does not have any href property to show the pointer.
Method 2: Using the onmouseover event for each link to change the style
The onmouseover event is triggered whenever the mouse pointer is moved over an element or its children. The style property of the element is accessed and the cursor property is changed.
The cursor property is used to specify the mouse cursor to be displayed when it is pointed over an element. Using the ‘pointer’ value in this property will change the cursor to a pointer indicating a link.
This event can be used on any link that does not have any href property to show the pointer.
- HTML | DOM Style cursor Property
- How to change cursor style using jQuery ?
- How to set href attribute at runtime?
- HTML | DOM Location href Property
- AngularJS | ng-href Directive
- HTML | DOM Anchor href Property
- HTML | DOM Base href Property
- HTML | DOM Link href Property
- HTML | <a> href Attribute
- HTML | <base> href Attribute
- HTML | <link> href Attribute
- HTML | <area> href Attribute
- Node | urlObject.href API
- How to make workaround for window.location.href?
- How to get an element by its href attribute ?
- How to link back out of a folder using the a-href tag?
- PHP | Print the last value of an array without affecting the pointer
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.