Having some trouble clicking a div using JavaScript in my project. I am able to utilize jQuery, and have tried selecting the element with QuerySelector
as well as XPath
, followed by utilizing .click()
on the element. However, it seems that the div is not being triggered when clicked.
document.querySelector('.GriddyLayout > div:nth-child(1)').click()
The specific website where I'm facing this issue can be found here. Running the provided code snippet in the Javascript console does not seem to select the desired option. Any insights on how to effectively click this button (div) using JS are greatly appreciated. Will acknowledge all responses with upvotes and will accept the solution that proves most effective or efficient.