LeaVerou / incrementable

Increment length values in textfields

Home Page:https://incrementable.verou.me

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Incrementable

Increment length values in textfields, like dev tools!

2022 Rewrite (v2)

  • ESM
  • Now preserves undo history!
  • Now selects the token that is being (in|de)cremented to make what is happening obvious

Usage

ESM-only:

import Incrementable from "https://incrementable.verou.me/incrementable.mjs";

let editor = document.querySelector("textarea");
new Incrementable(editor);

incrementable.js is identical to incrementable.mjs with the only difference that it also creates a global, so you can also use it like this:

<script type="module" src="https://incrementable.verou.me/incrementable.js"></script>
<script>
let editor = document.querySelector("textarea");
new Incrementable(editor);
</script>

This is useful for older scripts that check if Incrementable is available by checking if it's present on window.

About

Increment length values in textfields

https://incrementable.verou.me


Languages

Language:JavaScript 60.3%Language:CSS 23.8%Language:HTML 16.0%