Skip to main content
Site migration from WP to 11ty in progress. Some things may be temporarily broken.
{the} Amy Carney

Today's success... using jQuery's even selector to save time on making a list of museums stand apart from one another.

Code:

$(function(){$("ul.museumList li:even").addClass("blue");});

Before :even

before

After :even

after

It's just a little thing, but it makes a big difference when implementing the D.R.Y (don't repeat yourself) principle. One thing to note, if JavaScript is disabled on your user's browser, this will disappear. However, it's mostly for aesthetics and not accessibility, so it's not something I would worry about.