javascriptgoogle-chrome-extensiondom-eventsmousedown

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() {

});

Solution

  • It is mousedown not onmousedown.

    object.addEventListener("mousedown", myScript);
    

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