Example 1 — Count Submit Controls
Official idea: find :submit matches and report the length.
var submitEl = $("form :submit");
$("#result").text("jQuery matched " + submitEl.length + " elements.");
$("form").on("submit", function (e) { e.preventDefault(); }); How It Works
- Scope.
form :submitsearches submit controls inside the form. - Match. Both input and button submit controls are included.
- Report.
.lengthis how many matched.

