"The parent() method selectively accepts selector expressions of the same type". I don't understand this sentence. What does it mean to selectively accept selector expressions of the same type? - PHP Chinese website Q&A - "The parent() method is selective. I don’t understand this sentence. What does it mean to selectively accept selector expressions of the same type? - PHP Chinese website Q&A
"The parent() method selectively accepts selector expressions of the same type". I don't understand this sentence. What does it mean to selectively accept selector expressions of the same type? - PHP Chinese website Q&A - "The parent() method is selective. I don’t understand this sentence. What does it mean to selectively accept selector expressions of the same type? - PHP Chinese website Q&A
Take a look and learn.
有点类似于children()方法,parent()无参数表示允许我们能够在DOM树中搜索到这些元素的父级元素,从有序的向上匹配元素,并根据匹配的元素创建一个新的 jQuery 对象。而parent()有参数表示对这个合集对象进行一定的筛选,找出目标元素,所以允许传一个选择器的表达式,即接受同一型选择器表达式