<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<script type="text/javascript" src="js/jquery-3.0.0.js"></script>
<title>Document</title>
<script type="text/javascript">
$(function() {
setInterval(function() {
$("p.p").text($("input").val());
}, 10)
})
</script>
</head>
<body>
<p>
<input type="text" class="main" />
</p>
<p class="p">
0
</p>
</body>
</html>
利用定时器实现双向数据绑定效果
最新推荐文章于 2024-07-18 08:31:26 发布