User:Feeglgeef/tools.js

/** * Creates a menu item and appends it to the interaction menu. * @param {string} name - The text to be displayed for the menu item. * @param {string} url - The URL to link the menu item to. */ function createMenuItem(name, url) { const listItem = document.createElement('li'); listItem.className = 'mw-list-item'; const anchor = document.createElement('a'); anchor.innerHTML = name; anchor.href = url;

listItem.appendChild(anchor);

document.getElementById('p-interaction').children[1].children[0].appendChild(listItem); }