Home > Web Front-end > JS Tutorial > jquery click([data],fn) usage example introduction_jquery

jquery click([data],fn) usage example introduction_jquery

WBOY
Release: 2016-05-16 17:29:27
Original
1156 people have browsed it

click([[data],fn])
Return value: jQuery
Overview
Trigger the click event of each matching element.

This function will call and execute all functions bound to the click event.

Parameters
fnFunctionV1.0
The handler function bound in the click event of each matching element.

[data],fnString,FunctionV1.4.3
data:click([Data], fn) can pass in data for function fn to process.

fn: The handler function bound in the click event of each matching element.

Example
Description:
Trigger click events for all paragraphs in the page

jQuery code:
$("p").click( );Description:
Hide all paragraphs in the page by clicking on them.

jQuery code:
$("p").click( function () { $(this).hide(); }); The above is the content in the JQuery reference manual, and I have consulted many related Reference materials, but none of them explain the [data] parameter in detail

The parameter data is passed to the event object as the event.data attribute value and the additional data object
The parameter fn is bound to each selection element The handler function in the event

Copy code The code is as follows:



<br>JQuery [data] parameter usage instructions<br>









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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template