1

Below is my code in React.

var $img = $('<img>', {
src: src,
'data-asset-id': assetId,
draggable: false,
alt: 'Add image description',
title: 'Add image description'
});

This gets called when you upload an image. I hardcoded the alt text and title for the image, to test, as you can see above. But when I right click on the image and press 'inspect element', I see: this. It doesn't show me the alt text, or the title. So my question is, is the alt text being set properly, or what's wrong? Is there a better way to test if an image has alt text?

1 Answers1

1

So the problem was that some of the HTML attributes were getting stripped out while converting to CML. So all I had to change was the alt: true instead of false so that it doesn't get stripped out.