Latest Posts

I write about front-end web development. I'm inspired by Nathan Barry's motto, teach everything you know. I also take a lot of inspiration from my friend and mentor, Chris Ferdinandi.

The :target pseudo-class in CSS

A few weeks ago, we were working on a table of contents for the Vanilla JS Academy. It’s a script that dynamically creates a list of skip links from the headings in a document. It was a great opportunity to implement the :target pseudo-class, which is a neat CSS selector you might not know about.

The outerHTML property in vanilla JS

You probably know you can use the innerHTML property to update an element’s HTML content. But did you know you can use the outerHTML property to replace an element entirely?

Get an element's total width and height in vanilla JS

In jQuery, you can use the outerWidth() and outerHeight() methods to get an element’s total width and height including its padding and borders. You can easily do the same thing in vanilla JS with support back to IE9.