Currently browsing JavaScript DOM

Monday, September 25, 2023

Segmented Horizontal Bar Chart (Graph) Using Vanilla JavaScript

If you're looking to create a segmented (stepped) horizontal bar chart using nothing but vanilla JavaScript, you're in luck!

Friday, March 10, 2023

SEO Crawlability Issue: Resources are formatted as page link

While working on a Semrush audit, I found a new type of crawlability notice: 47 resources¬†are formatted as page link…

Tuesday, January 10, 2023

StackGrid – A Light Vanilla JavaScript Masonry Grid

Introducing the lightest and most efficient Masonry grid available – StackGrid – powered by pure vanilla JavaScript, no dependencies required.…

Tuesday, December 27, 2022

How to Open Only One Details/Summary Element at a Time

Let’s suppose you want to build a simple accordion or a help section, and you want to use a <details>…

Monday, July 4, 2022

JavaScript Form Validation

This JavaScript code snippet adds inline validation to any form field (input, select and textarea). Feel free to customise it…

Tuesday, May 24, 2022

Why I removed my dark theme switcher

How I implemented a dark/light theme switcher using JavaScript and CSS for both WordPress and static websites.

Friday, June 3, 2022

JavaScript Bookmarklets Collection

Bookmarklet 1: Show Password A simple JavaScript snippet can be used to view passwords in web browsers. To use the code,…

Tuesday, May 2, 2023

How to copy web page content using innerHTML

I need to extract some data from a web page and place it on a fishing site. The source web…

Tuesday, May 17, 2022

Random JavaScript Tutorials

I needed some structural updates for a site, and among them, I added some JavaScript snippets. I will show you…

Friday, June 3, 2022

How to create a simple JavaScript percentage graph (or chart)

This small JavaScript snippet creates percentage graphs out of raw (array) data. Just input the name/value pairs of the involved…

Monday, May 16, 2022

Vanilla JavaScript table date sorting

Say we have a table with dates, in the following format: We want to sort this table dynamically based on…

Monday, September 4, 2023

Tiny confirmation modal dialog in Vanilla JavaScript

A new addition to my Thin UI library, a much-needed modal dialog, this script is tiny, and it works with…