I want to add a created element li with a classname stored in an array, and I want to add this new element li with special classname to a static element with an id. I have an error appenChild is not a function. We are inside an JS object btw. The console display the right thing, it shows me the li with the good classname, but i cant add it to the id stacks-icons.
I would like the final result to be : adding in my ul a new li with a classname i have chosen in the array icons.
here the HTML and JS :
<ul id="stacks-icons">
<li></li>
</ul>
And the JS ( variables in constructor )
this.icons = ["fab fa-html5", "fab fa-css3"];
this.iconsRow = $('#stacks-icons');
And the method
let i = document.createElement('li');
i.className = this.icons[1];
this.iconsRow.appenChild(i);
console.log(i);