jQuery选择器-->层次选择器之ancestor descendant选择器

1.定义和用法

  ancestor descendant选择器中ancestor代表祖先,descendant代表子孙,用于在给定的祖先元素下匹配所有的后代元素

  使用公式:$("ancestor descendant")

      ancestor:是指任何有效的选择器

      descendant:是用以匹配元素的选择器,并且它是ancestor所指定元素的后代元素

  示例:

    $("ul li")  //匹配lu元素下的全部li元素

原文地址:https://www.cnblogs.com/abner-pan/p/12846135.html