<!DOCTYPE html> <html><head><meta charset="utf-8"><title>童心少年</title></head><body><p style="color:blue">假设y=5 计算 x=y+2 并显示结果。</p><button onclick="myFunction()">点击这里</button><p onclick="click1()"id="demo">gsgsgdg</p><script>function myFunction(){var x=5;var y=x+1;x=y;var demoP = document+x;}function click1(){var demo=document.getElementById("demo")demo.style="color:blue";}//var person={// firstname:"John",//lastname:"Doe",//id : 5566//};//document.write(person.lastname+"<br>");//document.write(person["lastname"]+"<br>");</script></body> </html>