📜  javascript代码示例中的.textcontent

📅  最后修改于: 2022-03-11 15:04:18.253000             🧑  作者: Mango

代码示例2
// to change the text displayed by a HTML element, you can access the textContent property
element.textContent = "some text";
// some elements like textareas and inputs have a value instead of textContent
element.value = "some text";
// you can get said element through its element
document.getElementById("element id");