Home  >  Article  >  Web Front-end  >  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中世界最好的语言
php中世界最好的语言Original
2018-04-26 13:54:442409browse

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');
});

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!

Statement:
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