How to automatically scroll to an element on a page

Different ways to automatically scroll to a particular HTML element on a page.

How to scroll to an element only if needed (using JavaScript)

Learn how to automatically scroll to an element on a page only if it’s outside the viewport or hidden behind a sticky header.

Useful JavaScript shortcuts in Visual Studio Code

Use these shortcuts to save time and automatically generate JavaScript code in Visual Studio Code.

How to execute JavaScript code only after the HTML structure (or the whole page) is loaded

Learn how to execute a JavaScript code only after the HTML content is ready or when the entire page has loaded.

User snippets in Visual Studio Code: A productivity game changer

Become a more efficient programmer by using the user snippets option in Visual Studio Code that lets you quickly insert your most frequently used code snippets.

 — Updated

How to get URL parameters with JavaScript

Learn how to check URL parameters using JavaScript.

JavaScript: Getting the value of a select element (dropdown) on change

Learn how to get the value of the selected option in a dropdown (select element) with JavaScript.

Copy to clipboard with JavaScript

Learn how to copy HTML content from an element with JavaScript.

JavaScript loops

3 methods to iterate over array items / list of elements with JavaScript.

 — Updated

Creating form fields with animated labels

Today we will create animated labels for form fields using HTML, CSS, and JavaScript.

Detecting filled form fields

Learn how to detect a form field that has been filled out.

How to check if a JavaScript array is not empty

Learn how to check if a JavaScript array has elements.

Getting an existing object of International Telephone Input

How to access an existing object of International Telephone Input (JavaScript plugin).

Advanced form reset using JavaScript

A JavaScript method for quickly resetting the entire form or only part of it.

Caching fetch requests with JavaScript

How to cache fetch requests using JavaScript to improve site performance.

Reading the contents of an external file with JavaScript

Learn how to read the contents of an external file without using the server side (JavaScript only).

Preventing double form submission using JavaScript

Learn how to easily prevent the same form from being submitted multiple times by mistake.

Converting jQuery object to vanilla JS

Learn how to convert a jQuery element to a vanilla JavaScript element.

A simple way to improve the stability of your JavaScript code

Use the try-and-catch method (a JavaScript best practice) to handle errors efficiently.

 — Updated