const webringContainer = '#webrings'; // edit this to be the selector of some container you want to put your webrings in const webrings = { // follow the structure here to add more items if you have more tyvnjam: { vars: 'https://kazehai.com/else/tyvnjam/variables.js', widget: 'https://kazehai.com/else/tyvnjam/widget.js' }, }; Object.keys(webrings).forEach((ring) => { const ringCont = document.createElement('div'); ringCont.id = ring; const vars = document.createElement('script'); vars.src = webrings[ring].vars; const widget = document.createElement('script'); widget.src = webrings[ring].widget; ringCont.appendChild(vars); ringCont.appendChild(widget); document.querySelector(webringContainer).appendChild(ringCont); });