jquery获取input输入框中值的几种方法jquery
jquery获取input输入框中值的几种方法...
用jquery获取input输入框的值有多种方法,可以通过id、name、type等属性指定获取。
比如想要获取下面input的输入值,通常有以下方法:
<input id="test" name="test" type="text"/> <script> $(" #test ").val() //通过id $(" input[ name='test' ] ").val() //通过name $(" input[ type='text' ] ").val() //通过type $(" input[ type='text' ]").attr("value") </script>
上一篇:jQuery tab选项卡切换
下一篇:没有了
我要评论