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