我该如何读取和修改dom元素的property属性呢?
我使用了console.dir(e),打印出了它的property,那么如何修改和读取这个对象里面的属性呢?
<!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>
<!-- 添加一个新的自定义attribute -->
<div id="box" class="box"></div>
</body>
<script>
const e = document.getElementById('box');
console.dir(e)
</script>
</html>
读
写