Image name 屬性

定義和用法
name 屬性可設置或返回圖像的名稱。
語法
imageObject.name=name
流覽器支持
所有主要流覽器都支持 name 屬性
實例
實例
返回圖片的名稱:
<html>
<body>
<img id="compman" name="compman"
src="compman.gif" alt="Computerman" width="107" height="98">
<br>
<script>
document.write("Image name: ");
document.write(document.getElementById('compman').name);
</script>
</body>
</html>
<body>
<img id="compman" name="compman"
src="compman.gif" alt="Computerman" width="107" height="98">
<br>
<script>
document.write("Image name: ");
document.write(document.getElementById('compman').name);
</script>
</body>
</html>
