<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
body {
font-family: "Microsoft YaHei", serif;
}
body, dl, dd, p, h1, h2, h3, h4, h5, h6 {
margin: 0;
}
ol, ul, li {
margin: 0;
padding: 0;
list-style: none;
}
img {
border: none
}
</style>
</head>
<body>
<div id="wrap" aqa="qwq"></div>
<script>
var oWrap = document.getElementById("wrap");
console.dir(oWrap);
console.log(oWrap.aqa); //undefined
// 一定要自己会在console中找
console.log(oWrap.attributes.aqa.nodeValue); //获取
oWrap.attributes.aqa.nodeValue = "aaa"; //设置
// 另外一种
// console.log(oWrap.getAttribute("aqa"));
// oWrap.setAttribute("aqa", "aaa")
</script>
</body>
</html>
Python3Turtle