Skip to main content

Bug Tracker

Side navigation

#13570 closed bug (notabug)

Opened March 06, 2013 07:01AM UTC

Closed March 13, 2013 12:48AM UTC

error in the description: addClass

Reported by: Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: git
Keywords: Cc:
Blocked by: Blocking:

<script type="text/javascript">
   $("ul li:last").addClass(function(index) {
      return "item-" + index;
   $("ul li").each(function(){


"Given an unordered list with five <li> elements, this example adds the class "item-4" to the last <li>."

not "item-4" -> "item-0"

Attachments (0)
Change History (2)

Changed March 06, 2013 08:39PM UTC by m_gol comment:1

This is expected, indexes go from 0. What did you expect? Also, if you think that something is broken, don't just paste code here but go to and create a test case that clearly states what you expect and demonstrates that it doesn't to that.

Changed March 13, 2013 12:48AM UTC by timmywil comment:2

resolution: → notabug
status: newclosed