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

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

WBOY
WBOYOriginal
2016-05-16 17:29:271082browse

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>









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
Previous article:A brief analysis on loading the common.css file carefully in LigerUi development_jqueryNext article:A brief analysis on loading the common.css file carefully in LigerUi development_jquery

Related articles

See more