jQuery选择器问题(如何选择表单中除按钮和复选框之外的所有输入字段) [英] jQuery selector question (how to select all input fields on a form EXCEPT buttons and checkbox)

查看:63
本文介绍了jQuery选择器问题(如何选择表单中除按钮和复选框之外的所有输入字段)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试选择表单上的所有输入字段(按钮和复选框除外).

I am trying to select all input fields on a form (except buttons and checkboxes).

我已经尽力选择ID为"myform"的表单上的所有表单输入元素,但是我不知道如何排除按钮和复选框项.有人知道该怎么做吗?

I have got as far as to select all the form input elements on a form with id "myform", but I dont know how to exclude buttons and checkbox items. Does anyone know how to do this?

这是我到目前为止所拥有的:

this is what I have so far:

$("#myform :input")

如何过滤"表单上的按钮和复选框?

How do I "filter out" buttons and checkboxes on the form?

推荐答案

$("#myform :input:not(:checkbox):not(:button)");

这篇关于jQuery选择器问题(如何选择表单中除按钮和复选框之外的所有输入字段)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆