jquery click ([data], Fn) usage example introduction

Probably means that the click event of each matching element is triggered. This article introduces the use of jQuery Click ([data], Fn) in detail through an example. Interested friends can refer to it, I hope to have something to everyone, I hope to have something to everyone. help
Return value: jquery
Trigger a click event of each matching element.

This function calls all functions that are bound to the CLICK event.

The processing function bound in each matching element event.

Data: CLick ([Data], Fn) can be transmitted into the data supply function FN processing.

fn: The processing function bound to each matching element event.

Trigger a click event in all paragraphs in the page

jquery code:
$ (“p”). CLICK (); Description:
Hide all paragraphs in the page after clicking.

jquery code:
$ (“p”). CLICK (function () {$ (this) .hide ();}); the above is the content of the jQuery reference manual. Parameter detailed description

parameter data is passed to an additional data object to the event object as an extra.data attribute value
Parameter FN is a processing function that is bound to an event in each selection element

Copy codecode is as follows:
<!DOCTYPE html>
<head><meta http-equiv=”Content-Type” content=”text/html;charset=utf-8″ /><meta http-equiv=”X-UA-Compatible” content=”IE=EmulateIE7″ /><title>
jquery [data] parameter instructions
</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”>
var message = “Pass the information to the Fn function”;
$ (“. TXT”). CLICK ({msg: message}, function (event) {$ (“# IDTIP”). Show (). Html (every.data.msg);}); // Settings text
<input class=”txt”></div>
<div id=”idTip”></div>

Leave a Reply

Your email address will not be published. Required fields are marked *