I have an img
tag. When the src
path is wrong, I need to collapse the img
tag. I can achieve this by using
onerror
in HTML4. However, XHTML1.0 is not allowing the onerror attribute.
How can I achieve this in XHTML1.0?
Thanks in advance
I have an img
tag. When the src
path is wrong, I need to collapse the img
tag. I can achieve this by using
onerror
in HTML4. However, XHTML1.0 is not allowing the onerror attribute.
How can I achieve this in XHTML1.0?
Thanks in advance
Copyright © 2021 Jogjafile Inc.
@Manikandan, I don't get idea how you want to collapse the img tag. but I use the following technique to use onerror with valid xHTML validation to show the default picture if original picture not found using Javascript. See if it can help you.