Reputation: 20102
My question is quite simple.. I need to convert an Element object into an html string
var thumb = new Element('img',{'src':"big.jpg"});
console.log( thumb.?????() ); //some magical method here
should return (as a string)
'<img src="_big.jpg">'
I've tried the .get('html')
but it returns nothing, obviously because the img tag has nothing inside.
Thanks in advance
Upvotes: 3
Views: 1379
Reputation: 11173
Returns a collection of elements from a string of html.
http://mootools.net/docs/more/Element/Elements.From
Upvotes: 0
Reputation: 26165
Just proxy it.
var html = new Element('div').adopt(yourel).get('html');
Upvotes: 3