Propriété lowsrcde l'image
Objet Image
Définition et utilisation
La propriété lowsrc définit ou renvoie l'URL d'une version basse résolution d'une image.
Syntaxe
imageObject.lowsrc=URL
Prise en charge des navigateurs
![]()
![]()
![]()
![]()
![]()
Tous les principaux navigateurs prennent en charge la propriété lowsrc.
Exemple
Exemple
L'exemple suivant crée un lien vers la version basse résolution d'une image :
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Rookie Tutorial (example.com)</title>
</head>
<body>
<img id="compman" src="compman.gif.html" lowsrc="compman_lowres.gif.html" alt="Computerman" width="107" height="98">
<br>
<script>
var x=document.getElementById("compman");
document.write('<a href="' + x.lowsrc + '">low resolution</a>');
</script>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title>Rookie Tutorial (example.com)</title>
</head>
<body>
<img id="compman" src="compman.gif.html" lowsrc="compman_lowres.gif.html" alt="Computerman" width="107" height="98">
<br>
<script>
var x=document.getElementById("compman");
document.write('<a href="' + x.lowsrc + '">low resolution</a>');
</script>
</body>
</html>
Essayez-le vous-même »
Objet Image Autres extensions