根据id document.getElementById("name").innerHTML="hello!"; 更新id为name的结点的内容: <p class="name" id="name"></p> 根据class $('.info').html("hello!"); 更新class为info的结点的内容: <p class="info"></p>