I am not really good in javascript so forgive me if I am confusing Object between other terms. The Object here is the HTML element. I don’t know why my it is rendered as [object HTMLImageElement] when placed in between strings. Here’s my code:
this.elem.find('img').map(function(index, elem){
markup += '<li>' + elem + '</li>';
});
It looks for images in a given container and wraps it with <li>. What should I do so that the actual image markup is rendered instead?
elem in your code points to the object that is of type ImageElement.
To access the value of the properties/attributes this element has you need to access the properties/attributes.
let say if it has a property named ‘value’ acess using elem.value
To ger the image markup i think elem.innerHTML should work. You can find better alternative in intellisense if this doesnt work.
Hope it helps.