Currently browsing JavaScript DOM

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,…

Friday, June 3, 2022

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, May 16, 2022

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…

Monday, May 16, 2022

How to add a top bar countdown for your next product sale

You can (probably) see this top bar right now, with a nice 30% off sale for my WordPress Lighthouse plugin.…

Friday, May 20, 2022

JavaScript Drag & Drop

Here’s a nice list of plain JavaScript dragging and dropping solutions. They are minimal, as they serve as proof of…

Monday, May 16, 2022

JavaScript Character Counter for Text Areas

A while ago, I had to implement a character counter for a business listing directory. The description field was supposed…

Monday, May 16, 2022

Carbon: Basic Syntax Highlighting with Zero Overhead Using JavaScript

If you have ever used PrismJS or CodeMirror or any other syntax highlighter solution, you’ll know it adds lots of…