use of each function in jquery code example
Example 1: jquery each
$( "li" ).each(function( index ) {
console.log( index + ": " + $( this ).text() );
});
Example 2: jquery each
$(querySelector).each(( index, value ) => {
// do stuff
});
$( "li" ).each(function( index ) {
console.log( index + ": " + $( this ).text() );
});
$(querySelector).each(( index, value ) => {
// do stuff
});