📜  获取段落内的文本 - Javascript 代码示例

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

代码示例1
const para=document.querySelector('p');
console.log(para.innerText); //innerText is a property of the para-variable NOT a method. (methods have())
//to get the property of a variable, put a period after the variable name.