1👍
✅
img
doesn’t have a length. You can test img.width
.
$(document).ready(function() {
var i = $('mythumb'); // using an id <img id='mythumb'.....
if( i.width === 0 ) i.src='y';
}
Using the same image will use the right place.
Source:stackexchange.com