<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div class="box">周冬雨</div>
</body>
<script>
let ele = document.querySelector('.box');
console.log(ele.nodeName);
console.log(ele.nodeType);
console.log(ele.childNodes[0].nodeValue);
</script>
</html>
js如何获得元素标签名
最新推荐文章于 2023-02-27 11:40:10 发布