Apr 30, 2005 #1 dudleys Technical User Apr 28, 2005 31 AU Hi, Can anyone tell me how to set an img to blank ie so you can see the alt property when viewing the page. I have tried img1.src = null Thanks in advance
Hi, Can anyone tell me how to set an img to blank ie so you can see the alt property when viewing the page. I have tried img1.src = null Thanks in advance
Apr 30, 2005 #2 tsuji Technical User Jul 25, 2001 10,675 US dudleys, Do it like this? [tt] <html> <head> </head> <body> <img src="myimg.jpg" alt="file myimg.jpg" /><br /> <button onclick="document.images[0].src=null">hide image</button></br /> <button onclick="document.images[0].src='myimg.jpg'">unhide image</button><br /> </body> </html> [/tt] regards - tsuji Upvote 0 Downvote
dudleys, Do it like this? [tt] <html> <head> </head> <body> <img src="myimg.jpg" alt="file myimg.jpg" /><br /> <button onclick="document.images[0].src=null">hide image</button></br /> <button onclick="document.images[0].src='myimg.jpg'">unhide image</button><br /> </body> </html> [/tt] regards - tsuji
Apr 30, 2005 #3 BillyRayPreachersSon Programmer Dec 8, 2003 17,047 GB dudleys, If you also give the image a title attribute, you will be able to see the text while the mouse is over the image (broken or otherwise, I believe). Relying on the alt text to show in its entirety may not always be practical if the image dimensions are quite small. Hope this helps, Dan [tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt] Upvote 0 Downvote
dudleys, If you also give the image a title attribute, you will be able to see the text while the mouse is over the image (broken or otherwise, I believe). Relying on the alt text to show in its entirety may not always be practical if the image dimensions are quite small. Hope this helps, Dan [tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]