首页 > Web开发 > 详细

jQuery对象转换为DOM对象

时间:2015-03-02 18:38:10      阅读:219      评论:0      收藏:0      [点我收藏+]

jQuery对象转换为DOM对象

$(‘.test‘).get(0)

$(‘.test‘)[0]
例子:
<html>
<head>
<title>转换为DOM对象</title>
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
//alert($(‘#txtName‘).value);//打印undefined
alert($(‘.test‘).get(1).value);//alert($(‘.test‘)[1].value);
});
</script>
</head>
<body>
姓名:<input id="txtName" name="txtName" value="tomzhang" class="test" />
年龄:<input id="txtAge" name="txtAge" value="31" class="test" />
</body>
</html>

jQuery对象转换为DOM对象

原文:http://www.cnblogs.com/jyb2014/p/4309267.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!