且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

HTML / Javascript更改div内容

更新时间:2023-12-02 11:27:04

Assuming you're not using jQuery or some other library that makes this sort of thing easier for you, you can just use the element's innerHTML property.

document.getElementById("content").innerHTML = "whatever";