Examples of the difference between a neutron element and a descendant element in jquery

Source: Internet
Author: User
Tags tag name

  Descendants, which are all descendants of the current element, are counted, the child element, is a subset of the current element, and then go down not forget

Today learning jquery's selector:    jquery selector is divided into basic selectors, hierarchical selectors, filter selectors, and form selectors.     Basic selector: Id,class, tag name, *, element combination (Div,span,p.myclass)     Hierarchy selector:    Difficulty: The difference between a neutron element in jquery and a descendant element   Descendants, is the current element of all descendants, are counted,  child elements, is the current subset of elements, and then go down not to forget.     Specific analysis can refer to the:  code as follows: <div>this is <strong>very</strong> important.</div>   <div>this is <em>really <strong>very</strong></em> important.</div>     above is HTML. After running in the browser is to see     This is very important.  the this is really very important.    style, in order to easily see the effect, we might as well try to use Add a CSS color to try     if run $ ("div strong"). CSS ("Color", "red") is to change the div's descendant element strong to red. After run     This is very important.  the this is really very important.    if run $ ("Div>strong"). CSS ("Co Lor "," Blue ") is the strong of the DIV's child elements into blue. After run are     This is very important.  this is really very important.    can be popular such understanding, such as having a family of three generations, grandpa, Father and you, this Grandpa's son is your father, and your father is also a descendant of Grandpa's elements, and you are just a grandfatherDescendant elements.    

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.