请用Jquery选择器选取User文本框输入的内容(至少写两种)

<form>
User:<input type="text" id="1001" name="username" />
Password:<input type="password" id="1002" name="pwd" />
</form>

参考解答

写法1:

$("#1001").val();

写法2:

$("form input[name=username]").val();

results matching ""

    No results matching ""