<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title></title> <script> window.onload = function () { var show = document.getElementById('show'); show.innerText = 'span赋值内容'; } </script> </head> <body> <span id="show"></span> </body> </html>