image javascript check code example
Example 1: javascript check image src
if (img.getAttribute('src') === 'on.png')
Example 2: javascript check if is image
function isFileImage(file) {
return file && file['type'].split('/')[0] === 'image';
}