得到jQuery detach()后节点中的某个值实现代码
需要jQuery -detach 后的dom 结构或某个值 。
代码如下:
<body> <input type="text" value="test" name="showtime" id="showtime" /> <input type="button" onclick='showDetach();'/> </body> <script type="text/javascript"> var obj = ''; setTimeout(function(){ obj=jQuery("#showtime").detach() ; // 需要用jquery转换一下。 },1000) ; function showDetach(){ alert(jQuery(obj).val()) ; } </script> </body>