📜  更改里面的文字<p>标签: - Javascript 代码示例

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

代码示例1
/*remember, in the previous section, the variable 'para' was set equal to the text in 
the first

, which was 'Hello' //we can now change that text, by changing the variable's value*/ const para=document.querySelector('p'); para.innerText='Goodbye';console.log(para.innerText);