When a user clicks on element 1. I want to have an event listener that will also click element 2 once element 1 is clicked. Below is what i currently am trying.
document.getElementById('element1t').addEventListener('click', function(){
alert('element1')
document.getElementById('element2').click()
console.log(document.getElementById('element2'))
})
The alert gets fired and and it does display that element in the console but the .click function doesnt seem to work.
Thanks in advance for anyone who can help