Home > Web Front-end > JS Tutorial > jquery implements the function of clicking the label to trigger the text box event

jquery implements the function of clicking the label to trigger the text box event

php中世界最好的语言
Release: 2018-04-26 13:54:44
Original
2490 people have browsed it

This time I will bring you jquery to implement the function of clicking the label to trigger the text box event . What are the precautions for jquery to implement the function of clicking the label to trigger the text box event. The following is a practical case. , let’s take a look.

var labelID;
$('label').click(function() {
    labelID = $(this).attr('for');
    $('#'+labelID).trigger('click');
});
Copy after login

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

Recommended reading:

Usage of jQuery Mobile initialization event (detailed case explanation)

What are the parameter passing methods of jquery mobile

How to use Mobile to control the get request when the page returns

Detailed explanation of the use of button button component in Mobile

The above is the detailed content of jquery implements the function of clicking the label to trigger the text box event. 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