JavaScript and JQuery: Interactive Front-End Web Development by Jon Duckett

JavaScript and JQuery: Interactive Front-End Web Development by Jon Duckett

Author:Jon Duckett [Jon Duckett]
Language: eng
Format: epub
Tags: JavaScript
Publisher: John Wiley & Sons
Published: 2014-06-29T21:00:00+00:00


USING INDEX NUMBERS

This example demonstrates how jQuery gives an index number to each of the elements in the jQuery selection.

The :lt() and :gt() selectors and the .eq() method are used to find elements based on their index numbers.

For each of the matching elements, the value of the class attributes are changed.

1. The :lt() selector is used in the selector to pick list items with an index number less than 2. It removes the value hot from their class attribute.

2. The .eq() method selects the first item (using the number 0 because the index numbers start at zero). It adds the value of complete to the class attribute.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.