SPlatten SPlatten - 1 year ago 118
Javascript Question

jquery filter on tag type and id

I would like to select all inputs excluding specific inputs by ID, the filter I have at the moment works for selecting all inputs that are not checkboxes or buttons, but I want to also exclude inputs with certain id's but how?

Current filter:

objInputs = $("INPUT:NOT(:CHECKBOX,:BUTTON)");

Answer Source

You can use add the ID selector in :not() selector to exclude them

objInputs = $("input:not(:checkbox,:button,#SomeID)")
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download