I'm curious why this code is invalid:
$.each( $("p") ).css("color", "green");
While this code works fine:
$.each($("p"), function() { $(this).css("color", "green") });
Is it not possible to chain elements with each?
Note that no version of each
is needed to achieve the (most likely) desired effect.
$("p").css("color", "green");
does the job.
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