How to trigger a onmousedown event manually from javascript (not jquery) on a empty td tag
I threw together a CodePen demo for you:
http://codepen.io/anon/pen/lrAxp
var element = document.getElementById('testButton');
if(document.createEvent)
{
element.dispatchEvent(new Event('mousedown'));
}
else{
// Internet Explorer (I think)
element.fireEvent("onmousedown", event);
}
You can also check out this SO post for more info: How to trigger event in JavaScript?