<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Planets</title>
    <script>
        //网页加载完成后再执行代码
        function init (){
            var planet = document.getElementById("greenplanet");
            planet.innerHTML = "Red alert: hit by phase fire!";
        }
        window.onload = init;

    </script>
</head>
<body>
    <h1>Green Planet</h1>
    <p >All is well</p>
    <h1>Red planet</h1>
    <p >Nothing to report</p>
    <h1>Blue planet</h1>
    <p >All system A-OK</p>
</body>
</html>

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-29
  • 2022-12-23
  • 2022-12-23
  • 2021-11-13
  • 2022-01-02
猜你喜欢
  • 2021-08-04
  • 2021-11-18
  • 2022-12-23
  • 2022-12-23
  • 2021-11-18
  • 2021-11-29
  • 2021-11-18
相关资源
相似解决方案