Example 1 — Official Demo: input[name!="newsletter"]
List inputs that are not named newsletter (including those with no name).
var names = $("input[name!='newsletter']").map(function () {
return this.name || "(none)";
}).get().join(", ");
console.log(names);
console.log("count:", $("input[name!='newsletter']").length); How It Works
- Scan inputs. The selector runs on every
input. - Exclude one name. Anything with
name="newsletter"is dropped. - Keep the rest. Other names and missing names both match.

