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
Filter Out Selection
Filter array elements matching button text on button click.
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
Navbar color change depending on hovered section
Dynamically update element colors on scroll based on visible section attributes.
By Digipop
Auto update copyright year
Dynamically updates an HTML element to display the current year using JavaScript.
By Digipop
Fetch - Put
Update server resource via PUT request using Fetch API.
By Jared Malan
Copy to Clipboard
Copy text to clipboard on button click with visual feedback and console log.
By Jared Malan
Validation - Email
Validates email format and handles invalid input on blur event.
By Jared Malan
Text Highlight Color
CSS code for high-contrast text selection: black background and white text.
By Jared Malan
Get localStorage
Retrieve and parse surfers data from localStorage.
By Jared Malan
Validation - Website
Validates URLs using regex and handles validation on input blur.
By Jared Malan
Ellipsis text
CSS class to truncate text with ellipsis when it overflows the container width.
By Jared Malan
Lenis Smooth Scrolling
Smooth scrolling setup using Lenis library with scroll event logging.
By Jared Malan
Select Radio on Load
Trigger parent element click based on radio button value.
By Jared Malan
Pointer events
CSS classes to control pointer events: .pointer-events-off disables interactions, .pointer-events-on enables interactions.
By Jared Malan
Auto-collapse accordion in Webflow
Toggle accordion elements with a click, ensuring only one can be open at a time.
By Digipop
Set localStorage
Store an array of surfer names in localStorage as a JSON string.
By Jared Malan
Greenhouse
Fetches and displays job listings from Greenhouse API, with department-based filtering.
By Green Malan