<!DOCTYPE html>
<html lang="zh-cn">
<title>test</title>
<script type="text/javascript" src="jquery.js"></script>
</head>
<body>
<input type="text" id="myinput" value="测试">
<script>
$(function(){
alert($("#myinput").val());
})
</script>
</body>
</html>
主要要先引入jQuery