There's a .val()
method:
(有一个.val()
方法:)
If you've got an input with an id of txtEmail
you can use the following code to access the value of the text box:
(如果您输入的id为txtEmail
,则可以使用以下代码访问文本框的值:)
$("#txtEmail").val()
You can also use the val(string)
method to set that value:
(您还可以使用val(string)
方法设置该值:)
$("#txtEmail").val("something")
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…