Random Number Generator - Online RNG Between Range
Generate truly random numbers within a specified range. Useful for contests, game decisions, and sampling. Runs locally, no hidden algorithms.
UD5 Toolkit
Welcome to the Selection & Range API Demo! This is an interactive playground where you can explore how the Selection and Range APIs work in the browser.
Try selecting some text with your mouse or keyboard. You can also click this link to see how anchor and focus behave. The contenteditable area allows you to modify text and observe how the DOM structure changes.
"The Selection API represents the user's selection, while the Range API provides granular control over document fragments."
Here is a bold red text and some inline code for variety. You can also find highlighted spans within the content.
Use presets or define a custom range to programmatically set the selection.
These operations modify the content. Use with care.
window.getSelection() and reflects what the user sees highlighted on screen. The Range API, on the other hand, represents a contiguous fragment of a document—defined by a start and end boundary. A Selection can contain multiple Ranges (though in practice, most browsers support only one). Use Selection for reading user intent and Range for precise DOM manipulation.
window.getSelection().toString() to get the plain text of the current selection. For more detailed information, access the Range via window.getSelection().getRangeAt(0) to inspect start/end containers, offsets, and bounding rectangles.
selection.isCollapsed or range.collapsed to determine this. Collapsed ranges are useful for inserting content at a specific point.
range.setStart(node, offset) and range.setEnd(node, offset), then apply it to the Selection: const sel = window.getSelection(); sel.removeAllRanges(); sel.addRange(range);. The node can be a text node (offsets are character positions) or an element node (offsets are child node indices).
DocumentFragment that you can re-insert elsewhere—useful for cut/paste or drag-and-drop functionalities. Both methods collapse the range after execution.
document.onselectionchange event (or use document.addEventListener('selectionchange', callback)). This event fires whenever the Selection object changes. Inside the handler, check window.getSelection() to get updated details. Note: this event can fire very frequently—debounce if needed.
selection.addRange() without removing existing ones), while Chromium-based browsers always replace. For consistent behavior, always call selection.removeAllRanges() before adding a new range.
Generate truly random numbers within a specified range. Useful for contests, game decisions, and sampling. Runs locally, no hidden algorithms.
Interactive cheatsheet for JavaScript regular expressions with live examples. Click any token to see its explanation and test it on sample text immediately.
Generate the doGet() and doPost() boilerplate for a Google Apps Script web app. Ready to paste into the editor.
Enter flight distance to see estimated CO2 emissions and how many trees it would take to absorb that over 10 years.
Choose Babel presets (env, React, TypeScript) and plugins. Get a clean babel.config.json to transpile your code. Local tool.
Answer questions about project type and strength needed to get a joint recommendation. Animations.
Choose base metal thickness and welding position to get the right rod diameter and amperage range. Beginner welder's quick reference.
Quick reference of HTTP methods with their semantics, idempotency, and example REST usage. Static, fast.
Drag pucks onto a digital lane to plan offensive and defensive shots. Practice before your next cruise.
Calculate maximum shutter speed before star trailing (NPF rule) and estimate trail length for creative effects.
Guided breathing exercises with animated circle for inhale/hold/exhale. Includes box breathing, 4-7-8, and resonant breathing patterns. Customizable intervals.
Choose the right extinguisher for kitchen, electrical, or garage fires. Interactive class chart. Home safety education.
Drag words to the correct position in a sentence using in, on, at. Visual feedback.
Search for common ingredient substitutions (e.g., buttermilk, egg, cornstarch). Quick reference for when you're missing something. Local data.
Search for the NaOH and KOH sap values of various oils. Reference for cold process soap makers.
Select an activity, enter your weight and duration, and see the estimated calories burned. Based on MET values.
Enter your bow's draw weight, arrow length, and point weight to find the correct arrow spine. Essential for tuning.
Enter number of rooms and get an estimate of how many moving boxes in each size you'll need. Plan your move efficiently. Local tool.
Add some trendy skills to your resume. Generate a list of hard and soft skills relevant for tech and business jobs.
Practice carrom shots on a virtual board. Visualize rebounds and plan your strike on the physical board.
Sortable list of cooking oils with smoke points and best uses. Choose the right fat for the right heat.
Generate strong random strings for API tokens, session secrets, or encryption keys. Uses crypto.getRandomValues().
Drag and drop pieces to set up a chess position. Generate FEN string and copy to share. Analyze openings. Local only.
Select a color in an image and change it to another hue. Canvas‑based, local processing.
Easily compute posterior probabilities given prior, likelihood, and marginal likelihood. Visual diagram. All local.
Drag the virtual ring to perform multiplication, division, and unit conversions. Rediscover pre‑electronic calculator charm.
Create and format Markdown tables by adjusting rows and columns. Align text, copy the raw Markdown. Perfect for README files.
Calculate wax weight and fragrance oil needed for container candles. Adjust fragrance load %. Common wax types supported. Local helper.
Control a lunar module and try to land softly on the moon. Manage fuel and thrust. Classic arcade physics. Canvas.
Chain multiple CSS filter functions and see the result on an image. Copy the filter string. No upload.