javascript设置p值的方法:1、使用getElementById()方法根据指定id获取到p元素对象;2、使用innerText属性设置p元素对象的值,语法“p元素对象.innerText="需要设置的值"”。本