运行 ❯
获取您的
自有
网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <head> <style> #myDIV { width: 500px; height: 500px; background-color: lightblue; } </style> </head> <body> <h1>Change cursor with JavaScript</h1> <p>Mouse over the DIV element to see what the cursor looks like.<p> <p>Click the "Try it" button, and mouse over the DIV element again to see that the cursor has changed:</p> <button onclick="myFunction()">Try it</button> <div id="myDIV"> <h3>Mouse over me, and check out the mouse-cursor.</h3> </div> <script> function myFunction() { document.getElementById("myDIV").style.cursor = "not-allowed"; } </script> </body> </html>