Home > Web Front-end > JS Tutorial > How to trigger click event by default on jQuery running page

How to trigger click event by default on jQuery running page

php中世界最好的语言
Release: 2018-03-15 10:39:45
Original
3258 people have browsed it

This time I will bring you jQueryHow to trigger the click event by default on the running pageEvent, and what are the notes to implement the jQuery running page to trigger the click event by default, The following is a practical case, let’s take a look.

For example:

1. $("#txt").trigger("click");//Default trigger clickSearchButton

2. $(".aaa .bbb").eq(0).click(); //The default is the first click (such as UL's LI has multiple clickable ones. The first one is clicked by default)

Note:

should be placed in function Outside, otherwise it won’t work

I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to the php Chinese website Other related articles!

Recommended reading:

How to use on and click in jquery

Tree shape in layui about values Detailed explanation of value passing

What problems will ajax encounter when requesting data

jquery realizes that after clicking a link, the link changes For custom color effects

The above is the detailed content of How to trigger click event by default on jQuery running page. For more information, please follow other related articles on the PHP Chinese website!

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