Bug Tracker

Opened 7 years ago

Closed 7 years ago

#11674 closed bug (fixed)

Logic error/typo on :checked documentation

Reported by: reames@… Owned by:
Priority: undecided Milestone: None
Component: unfiled Version:
Keywords: Cc:
Blocked by: Blocking:

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 (1)

comment:1 Changed 7 years ago by dmethvin

Resolution: fixed
Status: newclosed

Thanks!

Note: See TracTickets for help on using tickets.