Most browsers currently support pointer styles (move the mouse over the style name to observe the style changed to that style ):
Auto move no-drop col-resize
All-scroll pointer not-allowed row-resize
Crosshair progress e-resize ne-resize
Default text n-resize nw-resize
Help vertical-text s-resize se-resize
Inherit wait w-resize sw-resize
In windows internet explorer 6.0 or later, the pointer style is as follows:
To change the mouse pointer style of an element through a script, you can set the attribute element. style. cursor of the element to any value above. (Another method without javascript, you can use attributes in the html Tag of an element ):
Copy codeThe Code is as follows:
Function setcursorbyid (id, cursorstyle ){
If (document. getelementbyid ){
If (document. getelementbyid (id). style ){
Document. getelementbyid (id). style. cursor = cursorstyle;
}
}
}
Add a common method to change the mouse style: If you want to move the mouse over an element, change the mouse style and add cursor to the style of the element: (the style you want to change ).