Ryan Hawdon
Ryan Hawdon

Reputation: 389

AddEventListener: onmousedown

I am creating a Chrome Extension which checks to see if there is "onmousedown" attribute and if so I will execute some code.

I have tried this however it isn't working.

document.addEventListener("onmousedown", function() {

});

Upvotes: 6

Views: 29899

Answers (1)

user1839730
user1839730

Reputation:

It is mousedown not onmousedown.

object.addEventListener("mousedown", myScript);

ref: http://www.w3schools.com/jsref/event_onmousedown.asp

Upvotes: 19

Related Questions