Skip to content
Advertisement

how to trigger shift + left mouse click in Angular

There are 2 anchor elements as shown below.

JavaScript

when first element is clicked, it invokes popupIconClick() function in my .ts file. This finds the #newWindow element and should invoke the click function for this element but the click event should behave as if it was performed with shift key pressed.

JavaScript

Is this possible?

Advertisement

Answer

Dispatch a MouseEvent with shiftKey set to true

JavaScript

https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/shiftKey

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement