The instance of this paper tells the method of jQuery dynamic removal and increasing the onclick property. Share to everyone for reference, specifically:
Here you introduce
ATTR event to add a tag to the A tab and delete the onclick event. Operation method, friends who need to understand can be referred to.
To achieve the effect: Click the link first to remove the onclick property first, and then automatically add the onClick property in this tab in 3 seconds
jQuery, the operation of the label attribute It is achieved by
Attr () , such as
$ ("a"). Attr ("onclick") can get A tag
onclick Attribute, corresponding:
$ (selector) .attr (Property Name) It is to get the specified element ($ (selector) section The value of the specified attribute
Setting an OnClick property:
$ ("a"). Attr ("onclick", "test ();Delete event
, for example, deleting an OnClick property:
method for the Tag OnClick property!
jquERY 1.6 The previous version does not supportattr ()
Click on the onclick property to remove the link, then automatically add this onclick property after 3 seconds
jQuery deletion attribute Key words: removeAttr Note A is uppercase$ ("# S1"). UNBIND ("Click")
jQuery also has a method of lifting an event delegate: unbind ([evenettype]) . The parameters are optional, if not, indicate all binding events that remove the node.Here you only need to release the Click event, you can use
I hope this article will help you jQuery program.