Using attr, with pseudo-elements and JavaScript

Related post

This is amazing.

This is also amazing.

Requires a browser that supports DOMContentLoaded, classList, dataset and Array.prototype.map.