HTML DOM 이미지 이름 속성
정의 및 사용
속성 집합의 이름 또는 이미지의 이름을 반환합니다.
문법
imageObject.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>
»시도
이미지 개체