微件:External demands:修订间差异

来自Hyacinth
跳转到导航 跳转到搜索
删除的内容 添加的内容
草awa留言 | 贡献
无编辑摘要
草awa留言 | 贡献
无编辑摘要
第4行: 第4行:
const appendTo = document.getElementById('external_demand');
const appendTo = document.getElementById('external_demand');


const cats = new Map();
console.log("www");


for (let i = 0; i < elements.length; i++) {
for (let i = 0; i < elements.length; i++) {
const element = elements[i];
const element = elements[i];
const clone = element.cloneNode(true);
const clone = element.cloneNode(true);
appendTo.appendChild(clone);
if (!cats.has(clone.external_demand_from)) {
cats[clone.external_demand_from] = new Array();
}
cats[clone.external_demand_from].push(clone);
clone.style.display = 'inline';
clone.style.display = 'inline';
clone.classList.remove('external_demand_span')
clone.classList.remove('external_demand_span')
console.log(clone.custom_attr);
}
}

cats.forEach((value, key, map) => {
const p = document.createElement('p');
p.innerText = key;
appendTo.appendChild(p);
value.forEach((s) => {
appendTo.appendChild(s);
})
})


</script>
</script>

2024年4月11日 (四) 06:52的版本

<script>
const elements = document.getElementsByClassName('external_demand_span');

const appendTo = document.getElementById('external_demand');

const cats = new Map();

for (let i = 0; i < elements.length; i++) {
    const element = elements[i];
    const clone = element.cloneNode(true);
    if (!cats.has(clone.external_demand_from)) {
    	cats[clone.external_demand_from] = new Array();
    }
    cats[clone.external_demand_from].push(clone);
    clone.style.display = 'inline';
    clone.classList.remove('external_demand_span')
}

cats.forEach((value, key, map) => {
    const p = document.createElement('p');
    p.innerText = key;
    appendTo.appendChild(p);
    value.forEach((s) => {
        appendTo.appendChild(s);	
    })
})

</script>