<meta charset="utf-8"> <title>W3Cschool在线教程()</title> <div id="result"></div> <script> if(typeof(Storage)!=="undefined") { localStorage.sitename="W3Cschool在线教程"; document.getElementById("result").innerHTML="网站名:" + localStorage.sitename; } else { document.getElementById("result").innerHTML="对不起,您的浏览器不支持 web 存储。"; } </script> </meta charset="utf-8">