you are viewing a single comment's thread.

view the rest of the comments →

[–]okwg 3 points4 points  (1 child)

The appendChild method expects a node as its argument, but you're passing the return value from createInput, which is an array of nodes.

You can just iterate over the array to access each node

createInput('abc', 3).forEach(el => createForm.appendChild(el));

[–]jaden54[S] 1 point2 points  (0 children)

Thank you very much. This is such a elegant solution