📌  相关文章
📜  检查元素是否具有特定的子 javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:41.307000             🧑  作者: Mango

代码示例1
var hasChild = parentDiv.querySelector("#child2") != null;
//The querySelector() method lets you search the subtree beneath the 
//starting element using the given CSS selector string. If the element is found,
// its DOM node is returned.