3
我想获得输入字段中的文本的值。什么是最好的方式在jQuery中做到这一点。我尝试.text()它不起作用。jquery:输入文本如何获得
`
<html>
<head>
<title></title>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var t = $(":input").text();
alert(t);
});
</script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<form name="f">
<input type="text" name="t" value="cake">tes</input>
</form>
</body>
</html>
`
THnks COOOL