[JavaScript] 鼠标按下和鼠标释放时触发的事件onmousedown和onmouseup演示 →→→→→进入此内容的聊天室

来自 , 2020-11-03, 写在 JavaScript, 查看 123 次.
URL http://www.code666.cn/view/f4492508
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <script>
  5. function myFunction(elmnt,clr)
  6. {
  7. elmnt.style.color=clr;
  8. }
  9. </script>
  10. </head>
  11. <body>
  12.  
  13. <p onmousedown="myFunction(this,'red')" onmouseup="myFunction(this,'green')">
  14. Click the text to change the color. A function, with parameters, is triggered when the mouse button is pressed down, and again, with other parameters, when the mouse button is released.
  15. </p>
  16.  
  17. </body>
  18. </html>
  19.  
  20. //javascript/7966

回复 "鼠标按下和鼠标释放时触发的事件onmousedown和onmouseup演示"

这儿你可以回复上面这条便签

captcha