1.

How to select all even/odd rows in table?

Answer»

filter() is ONE of the jQuery DOM traversal methods which constructs a new jQuery object from a subset of the matching elements.

The following code is to select all the links in the page whose host name is DIFFERENT than the SITE host name and then applies css CLASS name “external”

$('a')  .filter((i, a) => a.hostname && a.hostname !== location.hostname  )  .addClass('external');


Discussion

No Comment Found