W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
运行代码
<html> <body> <img id="compman" src="/i/eg_compman.gif" alt="Computerman" /> <br /> <script type="text/javascript"> x=document.getElementsByTagName('img')[0]; document.write("Image id: " + x.id); document.write("<br />"); document.write("An alternate way: "); document.write(document.getElementById('compman').id); </script> </body> </html>