Add alternate text to pictures with Javascript on error - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Text

Description

Add alternate text to pictures with Javascript on error

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
 </head> <!--  w  w w .ja  v a 2s  .  c  om-->
 <body> 
  <img alt="picture 1/2" onerror="this.alt=this.alt+': not available'" src="https://www.java2s.com/style/demo/InternetExplorer.png">  
 </body>
</html>

Related Tutorials