All the ways that are described here depend on how you set up the listener: jQuery, element property.
If you want a robust way that will work regardless of how the event was setup, use How can I trigger a JavaScript event click
elements[0].onmousedown = function(){
fireEvent(elements[0], 'onmouseup');
};
Notice that you are probably better off wrapping the behavior of the mouseup handler into a function that you can call. Triggering handlers is usually code smell because you don't always know what else you may be triggering when firing events. For example:
function doSomethingOnMouseUp() {
console.log('something on mouse up');
}
elements[0].onmousedown = function(){
doSomething();
doSomethingOnMouseUp();
};
elements[0].onmouseup = doSomethingOnMouseUp;