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();
Comments
Post a Comment