x
 
<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>