Lowest price ever! Learn Generative AI for 48% less!
Get my discount+ 8
!onclick atribute
Is there a noclick atribute or any thing like that?
3 Answers
+ 10
A 'notclick' event isn't technically possible, as it will suppose that it's continously fired :P
But with 'onclick' event, you can handle a variable to store the state of the 'click' thanks to others 'click' events: 'onmousedown' is fired when the mouse button is pushed, while 'onmouseup' when the mouse button is released... So:
<script>
var clickState = false;
</script>
<div id="myDiv" onmousedown="clickState=true;" onmouseup="clickState=false;">
... obviously, you have to read the value of the global variable storing the state. You need to improve it for handle different element context, and/or set this handler to the <body> tag for having a kind of global mouse 'not' click listener ^^
+ 5
thnx :)
+ 4
noclick attribute don't exsist :) But good question, this interest me also :)