就像你在图片中看到的,我试图解决的这个问题,我不知道如何去寻找它,所以我画了它。我想把HTML语言中的文本放在每个点之前,每个元素都从数据库中获取信息,我的意思是数据点是r[4] + r[5]。
const column11 = document.createElement('p');
column11.setAttribute('class', 'card-text');
column11.textContent = 'Other' + r[4] + r[5]; // r[4] and r[5] should be wrapped with <code></code>

发布于 2021-03-25 14:44:13
// Database array
const r = [,,,,'Text', 'Text']
const column11 = document.createElement('p');
column11.setAttribute('class', 'card-text');
column11.textContent = 'Other ';
const code1 = document.createElement('code');
code1.textContent = r[4];
const code2 = document.createElement('code');
code2.textContent = r[5];
column11.appendChild(code1);
column11.appendChild(code2);
document.body.appendChild(column11);
https://stackoverflow.com/questions/66801658
复制相似问题