"Sharp jquery" Reading notes three

Source: Internet
Author: User

DOM Operations

Three aspects; DOM core Html-dom Css-dom

Note the point:

Remove three ways to remove nodes in an event remove detach empty

Remove does not explain

Detach does not remove the matched element from the jquery object to the data attached to the reserved bound event

<script type="Text/javascript">$ (function () {$ ("ul Li"). Click (function () {alert ($ ( This). HTML ())})//var $li = $ ("ul Li:eq (1)"). Remove (); No events                      var$li = $ ("ul Li:eq (1)"). Detach (); With Event $li. AppendTo ("ul"); })         </script>
Determine if there is a style

Hasclass () determines if a function has a class that returns true False

Is () determines whether there is a value of $ ("P"). Is (". Anthor")

DefaultValue form Element Initial value

This.defaultvalue The current text box default value

Drop-down box selection mode

Val () $ (": CheckBox"). Val (["Check2"]);

attr () $ (). attr ("selected", true);

To traverse a node:

Children () Gets a collection of matched sub-elements that only considers the child element regardless of its descendant elements

Parent () parents () closet () difference

Wait for updates .....

"Sharp jquery" Reading notes three

Related Article

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.