怎么实现每次实现addCb函数都能添加一次?且遍历星期1-7
<body>
<form action=" " method="post" id="fa">
<!-- <input type="checkbox" name="Cb1" value="a">星期1<br/>-->
</form>
<input type="button" onclick="addCb()" value="addCb" >
<script>
let oCheckbox=document.createElement("input");
let myText=document.createTextNode("星期1");
oCheckbox.setAttribute("type","checkbox");
oCheckbox.setAttribute("id","mayi");
function addCb() {
let fa=document.getElementById("fa");
fa.appendChild(oCheckbox);
fa.appendChild(myText);
}
</script>
</body>