HTML DOM atrybut name Obraz
Definicja i Wykorzystanie
wymienić zestawy własności lub zwraca nazwę obrazu.
gramatyka
imageObject.name=name
Pomoc Browser
Wszystkie główne przeglądarki obsługują nazwy atrybutu
Przykłady
Przykłady
Zwraca nazwę obrazka:
<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>
Spróbuj »
Obiekt Obraz