日期:2014-05-16 浏览次数:20329 次
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
</head>
<body>
<div id="aaa">
<input id="username" name="username" type="text">
</div>
<input type="button" value="html" id="btn" />
<script type="text/javascript">
$(function(){
$("#btn").click(function(){
$("#username").attr('value',$("#username").val());
var aaa = $("#aaa").html();
alert(aaa)
})
})
</script>
</body>
</html>