JS. How to replace html element with another element/text, represented in string?

后端 未结 8 1014
清酒与你
清酒与你 2020-12-24 03:03

I have a problem with replacing html elements.

For example, here is a table:

0
8条回答
  •  攒了一身酷
    2020-12-24 03:44

    use the attribute "innerHTML"

    somehow select the table:

    var a = document.getElementById('table, div, whatever node, id')
    a.innerHTML = your_text
    

提交回复
热议问题