Mobile app version of vmapp.org
Login or Join
Shelton105

: HTML img alt more than a line of text We all know that if an img in HTML cannot be loaded, the alt text will be rendered instead. What if I want the alt be, say, a div? Maybe some JavaScript

@Shelton105

Posted in: #Html5

We all know that if an img in HTML cannot be loaded, the alt text will be rendered instead. What if I want the alt be, say, a div? Maybe some JavaScript will help?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Shelton105

1 Comments

Sorted by latest first Latest Oldest Best

 

@Nimeshi995

You can use the alt tag within a DIV but that wouldn't be valid HTML or HTML5.


W3 Validator

Attribute alt not allowed on element div at this point.


You can however use title in HTML4/5 or data- in HTML5 with in DIV and other elements. The rest of your question is not clear and I recommend you edit it before people vote closure on it, also the question may become more suitable on Stack Overflow so please do ensure that you check their for similar questions and answers.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme