Converting HTML element to string in JavaScript / JQuery

前端 未结 5 477
一生所求
一生所求 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.

$(\'
').html();

note that outerHTML doesn't exist on older browsers but innerHTML still does (it doesn't exist for example in ff < 11 while it's still used on many older computers)

提交回复
热议问题