jQuery - Selector: Custom SelectorsTag: jQuery, $(), factory, function, selectors, custom selectors Category: JavaScriptpost: 21 Mar 2008 read: 537 jQuery Selector Step By Step Tutorial - Part 5: jQuery adds its own custom selectors. It wide variety of CSS and XPath selectors. The syntax is the same as the CSS pseudo-class syntax, where the selectors starts with a colon (:). For practice, we will style alternate rows. For this job, we use two custom selectors in the jQuery library, :odd and :even. Let's do it. First, create a html document named "customselector.html". enter with following code:
Then, create a file named "custom-song.css". Enter with following code:
Last, create a file named "custom-song.js". Enter with jQuery syntax like this:
Now, point your browser to customselector.html. You may get like this:
|
| | Give Your Opinion | Recommend |
|

