JQuery Removal Events

Source: Internet
Author: User

<! DOCTYPE html>
<meta charset= "UTF-8" >
<title>Title</title>
<body>
<input type= "button" id= "BTN" value= "button" >
<input type= "button" id= "del" value= "Delete event binding" >
<script src= "Jquery-1.11.3.js" ></script>
<script>
/* UNBIND ([type][,data]) */
Without parameters, all binding events are removed.
A parameter of the event type is provided, and only the binding event of that type is deleted.
The handler function passed at the time of binding is the second argument, and only that person-specific event handler is deleted.

/* $ (function () {
$ ("#btn"). Bind ("click", Fun1=function () {
Alert ("1")
}). bind ("click", Fun2=function () {
Alert ("2")
}). bind ("click", Fun3=function () {
Alert ("3")
});
$ ("#del"). Click (function () {
$ ("#btn"). Unbind ("click", Fun2)
})
});*/


One (); The binding event is triggered once and is immediately deleted
$ (function () {
$ ("#btn"). One ("click", Fun1=function () {
Alert ("222")
})
});

</script>
</body>

JQuery Removal Events

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.