javascript - Caching elements in jQuery (Internet Explorer?) -


<script>     var elem = null;     $(document).ready(function() {         $elem = $("#elem");         $("#parent").html('');         $("#parent").append($elem);     }); </script>  <div id="parent">     <div>         bla bla bla...     </div>     <div id="elem">         <div>             work's!         </div>     </div> </div> 

i want cache element id #elem als child nodes , text nodes , text nodes of child nodes. code above works in google chrome , firefox, in internet explorer (tested ie 10) child nodes of #elem missing.

any help? in advance.

alright, think jquery internal cloning/coding issue -- deep copy vs shallow copy!

using

$elem = $('#elem').clone(); 

works!


Comments

Popular posts from this blog

php - get table cell data from and place a copy in another table -

javascript - Mootools wait with Fx.Morph start -

php - Navigate throught databse rows -