Possible Duplicate:
Setting image src attribute not working in Chrome
When user clicks on “remove” link I need to set the src attribute of an image to empty. When I do it using
$('#img').prop('src', null);
src is not empty but points to current url
if I remove src using
$('#img').removeProp('src');
never let me to assign it back in the future
What’s the best way to accomplish this?
Try using attr(),
Live Demo
As you have id selector. Using the native javascript method document.getElementById will give you more performance benefit. Also you may need to set
#assrcinstead ofemptystring.