I’ve created an element as shown:
var imageElement = new Element('img', {
'src': item.Url,
'alt': item.Id,
'height': height + 'px',
'width': width + 'px',
'styles': {
'padding-left': paddingLeft + 'px',
'padding-top': paddingTop + 'px'
}
});
When I put a break point in to bring up a debugger and see what imageElement.get('html') returns, it’s an empty string.
Why might this be? Isn’t that how you’re suppose to get the innerHTML?
EDIT: Oh, how do I get its HTML then?
I’m unsure why would you want the IMG’s HTML when you can access it via its Object, but here you are:
HTML:
MooTools:
You can also create the wrapping element on-the-fly and then fetch its contents.