say there is an element #button with the attribute onmousedown containing some random javascript how could I trigger the js in that element attribute using jQuery?
j("#otherbutton").click(function(){
var script = j("#button").attr("onmousedown"); //what now?
});
Or
j("#button").trigger("mousedown");which will execute the code in theonmousedownattribute and any event handlers attached to the “mousedown” event.