The jquery click () method simulates the solution that the click event does not take effect for tag.
How to use a label normally
<A href = "www.phpernote.com"> </a>
Problem Analysis
Clicking tag A does not trigger the jump to the specified link. That is to say, we usually click the text in tag. To simulate A tag event by using JS, you must first add elements that can be captured by JS to the text in tag A, and then use JS to simulate and click the element.
Print $ ("a") [0] And get the http://www.phpernote.com, but in fact $ ("a") [0] is an object, maybe a DOM object is more appropriate.
Solution
Solution 1
Document. getElementById ("abc"). click ();
Use the native DOM element to operate the tag and call the native click () method;
Solution 2
$ ("# Abc") [0]. click ();
Convert a jquery object to a native DOM object
Summary
To simulate a click event, use the native DOM element to call the click () method;
Jquery objects cannot be called. Therefore, we recommend that you use native DOM objects to simulate clicks in future development.