var testdiv = '<div id="hello"><p>hiii</p>
<script type="text/javascript">some javascript functions</script>
</div>';
$(testdiv).appendTo(document.body);
After running above code, div that is added is missing javascript, i.e everything inside < script type="text/javascript" >
Is this known issue with appendTo ?