I am currently using JavaScript to dynamically create a button in Angular. While I have been successful in creating the button, I am encountering an error when attempting to change the classname.
The error message I am receiving is:
Property 'className' does not exist on type
HTMLCollectionOf<Element>
.
Here is the code snippet I am using:
var element = document.getElementsByClassName("btnshow")
element.innerHTML = "btnhide";
console.log(HTMLElement);