Correcting teacher:PHPz
Correction status:qualified
Teacher's comments:
<html>
<head>
<title>Title</title>
</head>
<body>
<script>
//通过类名获取所有元素的方法
function gclass(className, tagName) {
var alltags = document.getElementsByTagName(tagName || "*");
var arr=new Array();
for(let i=0; i<alltags.length; i++) {
var one = className.split(" ");
var two = alltags[i].className.split(" ");
if(isHasArray(one, two)) {
arr[arr.length] = alltags[i];
}
}
return arr;
}
</script>
</body>
</html>