In this post, we will see how to resolve How to click on the first <li> automatically when I come to the page?
Question:
I have this html block of code:<li>
:
But I would like to click on the first
Best Answer:
You’re clicking the element before attaching theclick
listener. This should work if you reorder your code like this:If you have better answer, please add a comment about this, thank you!
Source: Stackoverflow.com