All Projects β†’ abhas9 β†’ vanilla-caret-js

abhas9 / vanilla-caret-js

Licence: MIT license
Set and get Caret position (contenteditable or TextArea) using Vanilla JavaScript

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to vanilla-caret-js

django-addendum
πŸ“œ Easily edit arbitrary text snippets on a site without a full-fledged CMS or issuing another site release. Like a mini-CMS for every site.
Stars: ✭ 71 (+129.03%)
Mutual labels:  contenteditable
html5parser
A super tiny and fast html5 AST parser.
Stars: ✭ 153 (+393.55%)
Mutual labels:  dom
render-props
㸚 Easy-to-use React state containers which utilize the render props (function as child) pattern
Stars: ✭ 33 (+6.45%)
Mutual labels:  dom
dom-lite
A small DOM library for server-side testing, rendering, and handling of HTML files
Stars: ✭ 18 (-41.94%)
Mutual labels:  dom
Web-Map-Custom-Element
A custom <mapml-viewer> and <layer-> element suite
Stars: ✭ 49 (+58.06%)
Mutual labels:  dom
bs-declaredom
Strongly typed declarative markup for the DOM and CSS
Stars: ✭ 66 (+112.9%)
Mutual labels:  dom
Swiftsoup
SwiftSoup: Pure Swift HTML Parser, with best of DOM, CSS, and jquery (Supports Linux, iOS, Mac, tvOS, watchOS)
Stars: ✭ 3,079 (+9832.26%)
Mutual labels:  dom
playwright-demos
playwright for scrapping and UI testing / automate testing workflows
Stars: ✭ 65 (+109.68%)
Mutual labels:  dom
InDiv
an angular like web mvvm framework.δΈ€δΈͺη±» angular ε‰η«―ζ‘†ζžΆγ€‚https://dimalilongji.github.io/InDiv
Stars: ✭ 88 (+183.87%)
Mutual labels:  dom
necktie
Necktie – a simple DOM binding tool
Stars: ✭ 43 (+38.71%)
Mutual labels:  dom
string-dom
Create HTML strings using JSX (or functions).
Stars: ✭ 13 (-58.06%)
Mutual labels:  dom
hast-util-from-dom
utility to transform a DOM tree to hast
Stars: ✭ 20 (-35.48%)
Mutual labels:  dom
glimmer-dsl-opal
Glimmer DSL for Opal (Pure-Ruby Web GUI and Auto-Webifier of Desktop Apps)
Stars: ✭ 22 (-29.03%)
Mutual labels:  dom
hypercomponent
⚑ Fast and light component system, backed by hyperHTML
Stars: ✭ 45 (+45.16%)
Mutual labels:  dom
rehype-dom
HTML processor to parse and compile with browser APIs, powered by plugins
Stars: ✭ 20 (-35.48%)
Mutual labels:  dom
html-parser
A simple and general purpose html/xhtml parser, using Pest.
Stars: ✭ 56 (+80.65%)
Mutual labels:  dom
aurum
Fast and concise declarative DOM rendering library for javascript
Stars: ✭ 17 (-45.16%)
Mutual labels:  dom
dom
Package for access and manipulate DOM element in HTML file
Stars: ✭ 29 (-6.45%)
Mutual labels:  dom
universal
A counterpart to common package to be used with Angular Universal
Stars: ✭ 115 (+270.97%)
Mutual labels:  dom
vue-drag-select
A Vue component for drag selecting elements. Inspired by react-drag-select.
Stars: ✭ 73 (+135.48%)
Mutual labels:  dom

Set and get Caret position (contenteditable or TextArea) using Vanilla JavaScript

NPM version NPM size Build Status Donate MIT License

Demo

Demo

Setup

$ npm i vanilla-caret-js
const VanillaCaret = require('vanilla-caret-js');

OR

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/VanillaCaret.min.js"></script>

Example Usage

var caret = new VanillaCaret(document.getElementById('root')); // Initialize
caret.setPos(4); // Set
document.getElementById('currentPosition').value = caret.getPos(); // Get

Development

Once you've downloaded the files in this repo please run the following command in your terminal from the project folder (it may require sudo):

$ npm install

Available tasks

Build and test

$ node make # or also `$ npm run default`

Convert the ES6 code into valid ES5 combining all the modules into one single file

$ node make build # or also `$ npm run build`

Start a nodejs static server

$ node make serve # or also `$ npm run serve`
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].