<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="js/jquery-1.11.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("input[type='button']").click(function() {
var inputValue = $("#testInput").val();
alert(inputValue);
})
})
</script>
</head>
<body>
<input type="text" id="testInput" name="test" value="" />
<input type="button" value="请输入值" />
</body>
</html>
console