<p id=”myPar”>I am a paragraph.</p>
<div id=”myDiv”>I am a div.</div>
<p>
<button type=”button” onclick=”myFunction()”>点击这里</button>
</p>
<script>
function myFunction()
{
document.getElementById(“myPar”).innerHTML=”Hello World”;
document.getElementById(“myDiv”).innerHTML=”How are you?”;
}
</script>
<p>当您点击上面的按钮时,两个元素会改变。</p>
关于作者