我的问题很简单..我需要将一个 Element 对象转换成一个 html 字符串
var thumb = new Element('img',{'src':"big.jpg"});
console.log( thumb.?????() ); //some magical method here
应该返回(作为一个字符串)
'<img src="_big.jpg">'
我试过 .get('html')
但它没有返回任何内容,显然是因为 img 标签里面没有任何内容。
提前致谢
最佳答案
只是代理它。
var html = new Element('div').adopt(yourel).get('html');
关于javascript - Mootools 元素到 HTML,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11158996/