首页 > Web开发 > 详细

jQuery val() - 获取值

时间:2017-06-27 18:27:45      阅读:259      评论:0      收藏:0      [点我收藏+]

<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head>
<script src="http://cdn.static.runoob.com/libs/jquery/1.10.2/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("button").click(function(){
alert("值为: " + $("#test").val());
});
});
</script>
</head>

<body>
<p>名称: <input type="text" id="test" value="测试"></p>
<button>显示值</button>
</body>
</html>

jQuery val() - 获取值

原文:http://www.cnblogs.com/yl514/p/7086390.html

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