jquery's element-bound events can be extracted using the data method .
through the (element). Data ("events") to obtain
//For example, to bind a button to two click events
$ ("button"). Click (function () {alert ("1")});
$ ("button"). Click (function () {alert ("2")});
//Click the button at this time to pop up the 2 and 1 alert boxes respectively
//Remove all click events for the button, which is the array
$ ("button"). Data (' Events '). Click
you see an array of two click events
get the array, you can adjust the order and then set it back.
$ ("button"). Data (' Events '). Click = Neweventarray;
The following is a test page for this method:
<span style= "FONT-SIZE:18PX;" ><%@ page contenttype= "Text/html;charset=utf-8" language= "java"%> <! DOCTYPE html>
Copyright notice: This article blog original article. Blogs, without consent, may not be reproduced.
jquery buys events on elements