首页 > 语言 > JavaScript > 正文

得到jQuery detach()后节点中的某个值实现代码

2024-05-06 14:19:41
字体:
来源:转载
供稿:网友
需要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>
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表

图片精选