Bug Tracker

Modify

Ticket #11674 (closed bug: fixed)

Opened 14 months ago

Last modified 14 months ago

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

comment:1 Changed 14 months ago by dmethvin

  • Status changed from new to closed
  • Resolution set to fixed

Thanks!

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.