I\'m trying to trigger the click event of the element from the button.
button
best and simple way to use native java Script which is one liner code.
document.querySelector('#id').click();
Just add 'id' to your html element like
check condition in javascript code
if(condition) { document.querySelector('#myId1').click(); }