Probably the meaning is to trigger each matching element Click event, this article through an example for everybody detailed introduction jquery click ([Data],fn) The use method, the interest friend may refer to Ha, hoped that has the help to everybody
Click ([[DATA],FN])
return value: JQuery
Overview
Triggers the Click event for each matching element.
This function invokes all functions that perform binding to the Click event.
Parameters
fnFunctionV1.0
The handler function that is bound in each matching element's Click event.
[data],fnstring,functionv1.4.3
Data:click ([Data], FN) can be passed in to the Data for the function fn processing.
fn: The handler function that is bound in each matching element's Click event.
Sample
Describe:
Triggers click events for all paragraphs within the page
JQuery Code:
$ ("P"). Click (), Description:
Click and hide all paragraphs in the page.
JQuery Code:
$ ("P"). Click (function () {$ (this). Hide ();}); The above is a jquery reference manual that looks at a number of references, but none of the [data] parameters are described in detail
Parameter data is an additional data object passed to the event object as a Event.data property value
Parameter FN is a handler in the event that is bound to each selection element
Copy Code code as follows:
<! DOCTYPE html>
JQuery [data] parameter usage description
</title><link href= "css/main.css" type= "Text/css" rel= "stylesheet"/>
<script src= " Jquery-1.8.3.min.js "type=" Text/javascript "></script>
<script type=" Text/javascript ">
$ (function () {
var message= "Passes this information to the FN function";
$ (". txt"). Click ({msg:message},function (event) {$ ("#idTip"). Show (). HTML (EVENT.DATA.MSG); /Set Text
});
</script>
<body>
<input class= "txt" ></div>
<div id= "IdT IP "></div>
</body>