Home > Web Front-end > JS Tutorial > Use JS or jQuery to simulate mouse click a label event code_jquery

Use JS or jQuery to simulate mouse click a label event code_jquery

WBOY
Release: 2016-05-16 16:55:56
Original
1426 people have browsed it
Copy code The code is as follows:


$("#alink").click(); // The click event of the a tag is triggered, but the page jump is not triggered
document.getElementById("alink").click(); //It not only triggers the click event of the a tag, but also triggers the page jump

Change "next step" to "< span id="spanId">Next step" That is, add an element that can be captured by jQuery to the text in the A tag, and then $("#spanId").click(); to trigger the page jump.
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template