DOM HTML Nom de l'image attribut
Définition et utilisation
nommer des ensembles de propriétés ou retourne le nom de l'image.
grammaire
imageObject.name=name
support du navigateur
Tous les principaux navigateurs supportent nom d'attribut
Exemples
Exemples
Retourne le nom de l'image:
<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>
Essayez »
objet image