<a href="#">Link</a>
<button>Trigger click</button>
document.querySelector('a').addEventListener('click', event => {
alert(event.isTrusted)
})
document.querySelector('button').addEventListener('click', () => {
document.querySelector('a').click()
})
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.