While exploring similar questions on this topic, I have unfortunately not come across a solution that works for me. My challenge is trying to insert two a
elements inside of a newly created div
element using appendChild
. However, I am unable to append them together as it only accepts one argument.
let view = this.view as Nullable<HTMLElement>;
let link_1 = document.createElement('a');
let link_2 = document.createElement('a');
let link_container = document.createElement('div');
link_container.setAttribute('style', 'display: flex;');
const cont = link_container.appendChild(link_1, link_2);
view?.appendChild(cont);
I am really in need of a functional solution to this problem.