JQuery simulates clicking on the A tag example reference
- 2020-03-30 02:41:03
I puzzled over the question for half an hour, and then I thought it was so.
<li class="menu"><a href="xxx.com" target="_blank"></a></li>
Click < Li> When the inner hyperconnection is triggered:
//The right choice $("li.menu").children("a").click() //The following is not possible $("li.menu").children("a").eq(0).click()
- says parameter error, no bound click event function found,
Because eq(0) returns a jQuery object, when click() happens, it looks for a function bound to it, but it doesn't bind to a function at all, so it has an error.
,  returns a DOM object, and when click() occurs, the original behavior of the element is executed.
Note : is the same thing as get(0).