Why isn’t append child working to my todolist in javascript?

I am trying to append a new li item along with the close element to my list in this to do list web-project.Why isn’t it working?
Here is my js code:

addbutton=document.getelementbyid("addbutton");
> addbutton.addeventlistener('onclick', addtolist); function
> addtolist(e){   const ultag=document.queryselector("#myUL");
> const myinputvalue=document.getelementbyid("myinput").value; 
> const newli=document.createelement("li");   newli.innerHTML=myinputvalue;  
> ultag.appendchild(newli);
> const addedx=document.createelement("span");    addedx.innertext="x";   
> added.classname="close";    newli.appendchild(addedx); };

Source: Ask Javascript Questions

LEAVE A COMMENT