I am trying to dynamically build a modal form, but when I search for my modal, then create a new child, it doesn't allow me to append them. The modal is set by class, should it be an ID instead? Please don't reference w3schools; I am using that and it's not helpful.
var a=document.getElementsByClassName('modal');
undefined
var b = document.createElement("p");
undefined
b.appendChild(a);
Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.
at <anonymous>:1:3