笔记 · · 557 阅读

input框绑定事件

js jquery
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>

<input class="aa" value="" type="text" />
<span class="bb"></span>


<script>
$('.aa').bind('input propertychange', function() {
 searchProductClassbyName();
});
function searchProductClassbyName() {
  $('.bb').html($('.aa').val());
}
</script>