To iterate through each specified element of the page, each()
method can be used.
<script>
$('p').each(function (index) { alert(index + ': ' + $(this).text()); });
</script>
Above code snippet will iterate through every paragraph of the page and alert its zero based index (position/order in the page from top and its text).
Views: 6866 | Post Order: 41