I want to clone the html of ‘divhtml’ to ‘divPlainHtml’ but the code below doesn’t work: after its execution, $(‘#divPlainHtml’) returns empty object []
$('#divhtml').clone(false).
appendTo('<div id="divPlainHtml" style="display: none;"></div>')
The reason is,
divPlainHtmldoes not exist in the DOM to append to. Try this.