Answers
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>test</title>
</head>
<body>
<input type="text" />
<button>1</button>
<button>2</button>
<button>3</button>
<button>4</button>
<script src="//code.jquery.com/jquery-1.10.2.min.js"></script>
<script>
$(function() {
$('button').click(function() {
$('input').val($('input').val() + $(this).text()).focus();
});
})
</script>
</body>
</html>
依文丶洁琳
answered 11 years, 2 months ago