How to replace non-existing images with a default one in css?
I have a table of 10 rows which has an image of a user in first column:
<table> <tr><td><img src='images/35067.png'/></td></tr> <tr><td><img src='images/35089.png'/></td></tr> .... <!-- more rows --> </table>
the image file name is generated by the [id] of its data record within mysql. some users have no image assigned to them and the file dose not exists in the [images/] path. i would like to replace the invalid images with a default existing image like
i have some conditions that the action must be done on the client side, not on server-side and it could be done aether with CSS or java-script.
This would work
<img src='images/35067.png' onerror='this.src="images/default.png"'/>