Modify ↓
Ticket #11674 (closed bug: fixed)
Logic error/typo on :checked documentation
| Reported by: | reames@… | Owned by: | |
|---|---|---|---|
| Priority: | undecided | Milestone: | None |
| Component: | unfiled | Version: | |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
In the :checked selected documentation.
function countChecked() {
var n = $("input:checked").length;
$("div").text(n + (n <= 1 ? " is" : " are") + " checked!");
}
This function, the comparison should be n != 1. Otherwise for zero it reads "0 is checked"
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

Thanks!