Inputting a default image in case the src attribute of an html

后端 未结 22 2443
渐次进展
渐次进展 2020-11-22 16:02

Is there any way to render a default image in an HTML tag, in case the src attribute is invalid (using only HTML)? If not, what would

22条回答
  •  温柔的废话
    2020-11-22 16:37

    In addition to Patrick's brilliant answer, for those of you who are searching for a cross-platform angular js solution, here you go:

    
        
    
    

    Here's a plunk where I was playing trying to find the right solution: http://plnkr.co/edit/nL6FQ6kMK33NJeW8DVDY?p=preview

提交回复
热议问题