Select from following answers:- each()

- eql()
- filter()
- find()
- All Above
To iterate through each specified element of the page, each() method can be used.
For example:
$('p').each(function (index) { alert(index + ': ' + $(this).text()); });
Above code snippet will iterate through every paragraph of the page and alert its zero based index (position in the page and its text).
Show Correct Answer
Asked In: Spotted While Learning |
Alert Moderator