Converting HTML element to string in JavaScript / JQuery

前端 未结 5 465
一生所求
一生所求 2021-02-05 05:48

I would like to convert a html element created from a string back to the string after some modifications. But I get an empty string instead.

$(\'');    
var str = $html.prop('outerHTML');
console.log(str);

FIDDLE DEMO

提交回复
热议问题