Set localStorage
Store an array of surfer names in localStorage as a JSON string.
By Jared Malan
Refresh after form submit
Automatically refreshes the page 7 seconds after any form submission.
By Corey Moen
Track User Localstorage
Tracks user navigation and populates a form field with the history.
By Jared Malan
Fetch - Post
This code sends a POST request with JSON data to a specific URL, processes the JSON response, and handles any errors.
By Jared Malan
Lenis Smooth Scrolling
Smooth scrolling setup using Lenis library with scroll event logging.
By Jared Malan
Validation - Phone
Validates phone number format and handles errors on input field blur.
By Jared Malan
Hide element if collection is empty
Hide sections based on dynamic content state using jQuery.
By Corey Moen
Ellipsis text
CSS class to truncate text with ellipsis when it overflows the container width.
By Jared Malan
Fetch - Get
A JavaScript code snippet that fetches data from a URL, converts the response to JSON, and logs the data or any error to the console.
By Jared Malan
Expand text on click
Toggle visibility of text sections with "Read More" buttons using JavaScript.
By Andrea Morgan
Currency to Number
Convert currency string to number by removing non-digit characters and parsing to float. Throws error for invalid input.
By Jared Malan
Print Page Button
Trigger browser print dialog on clicking element with ID 'print'.
By Digipop
Richtext Reset
Removes top margin of the first and bottom margin of the last child elements in a rich text container.
By Jared Malan
Rive - Set Text Run Value
Update the string of text used in a Rive text run at runtime
By Jeff McAvoy
Animated American Flag
Render and animate an American flag on a canvas with dynamic waving effects.
By Jared Malan
Validation - Website
Validates URLs using regex and handles validation on input blur.
By Jared Malan
GSAP card staggered animation
Animate elements on viewport entry with GSAP and ScrollTrigger.
By Digipop
Number to Currency
Formats a string input as US dollar currency without decimal places.
By Jared Malan