Invoking mouse events through JavaScript

Handling Mouse Events through Java script

In some scenarios, we may need to invoke a button click through script. We can write, but that will not work in all the browsers. We may need to do this in another way, please check the below code snippet.

function invokeSaveClick(saveElementId) {
    var e = document.createEvent('MouseEvents');
    e.initEvent('click', true, true);

No comments:

Post a Comment