I have a project that I am doing for a class involving making custom HTML tags using JavaScript. I have a for loop to loop over every time the tag is used. When I run the code, it only loops over every odd tag. I am trying to make an alert tag in html.
for (i = 0; i < document.querySelectorAll("alert").length; i++) {
console.log(document.querySelectorAll("alert")[i].innerHTML);
document.querySelectorAll("alert")[i].remove();
}
<body>
<alert>Hello!</alert>
<alert>How do you do?</alert>
<alert>Are you doing good?</alert>
<alert>I hope you are!</alert>
<alert>Bizzle</alert>
<alert>Fizzle</alert>
<alert>Grizzle</alert>
</body>