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.
$(\'
You can do this:
var $html = $(''); var str = $html.prop('outerHTML'); console.log(str);
FIDDLE DEMO