📌  相关文章
📜  javascript 获取第二个父母的最简单方法 - Javascript 代码示例

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

代码示例1
// If you want to target the parent by tagName you could use .closest(selector); like :
var x = document.getElementById("myLI").closest('section');
// NOTE : Take a look to the Browser compatibility section.