Bug Tracker

Opened 11 years ago

Closed 11 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:


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 11 years ago by dmethvin

Resolution: fixed
Status: newclosed


Note: See TracTickets for help on using tickets.