Is there a way to detect if the javascript see if there was a click, and if there was, it can do something?
function clickin() {
var mouseDown = 0;
document.body.onmousedown = function() {
++mouseDown;
var alle = document.getElementsByClassName('box');
for (var i = 0; i < alle.length; i++) {
value = "this.title='1'"
alle[i].setAttribute("onmouseover", value);
}
document.body.onmouseup = function() {
--mouseDown;
var alle = document.getElementsByClassName('box');
for (var i = 0; i < alle.length; i++) {
value = "0"
alle[i].setAttribute("onmouseover", value);
}
}
}
}
And the question is?
You have already the code.
Anyway, from my point of view, go for jQuery and it’s mouse events.