This will output [object HTMLUListElement]:
ul = document.create('ul');
$('textarea').val(ul)
How do I get it to output <ul></ul>?
This will do the work but is there any way to get it directly from the html element object?
s = ul.wrap('<div></div>')
$('textarea').val(s.html())