document.addEventListener("DOMContentLoaded", function() { const linksContainer = document.querySelector('.links-table'); const lists = document.getElementsByTagName('list'); // 获取所有 list 标签 Array.from(lists).forEach(list => { console.log(list.getAttribute('name'), list.getAttribute('content')); const row = document.createElement('div'); row.className = 'links-row'; const cellName = document.createElement('div'); cellName.className = 'links-cell name-cell'; cellName.textContent = list.getAttribute('name'); const cellLink = document.createElement('div'); cellLink.className = 'links-cell link-cell'; const link = document.createElement('a'); link.href = list.getAttribute('content'); link.target = "_blank"; link.className = 'button'; //link.textContent = '点击充值'; // 添加按钮文本 cellLink.appendChild(link); row.appendChild(cellName); row.appendChild(cellLink); linksContainer.appendChild(row); }); });