<!DOCTYPE html> <html> <body> <h1>Window Location 对象</h1> <h2>host 属性</h2> <p id="demo"></p> <script> let host = location.host; document.getElementById("demo").innerHTML = host; </script> </body> </html>