Within an each() loop, is it possible to do something with the first element in particular, not the next ones? Something like this:
$( '.selector').each(function(){
// if first element found, do something
});
$('.selector').each(function(i, el){
if ( i === 0) {
// Will be done to first element.
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With