seleccion

WebJar for seleccion

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

seleccion
Last Version

Last Version

2.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

seleccion
WebJar for seleccion
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/bevacqua/seleccion

Download seleccion

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/seleccion/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>seleccion</artifactId>
    <version>2.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/seleccion/
implementation 'org.webjars.npm:seleccion:2.0.0'
// https://jarcasting.com/artifacts/org.webjars.npm/seleccion/
implementation ("org.webjars.npm:seleccion:2.0.0")
'org.webjars.npm:seleccion:jar:2.0.0'
<dependency org="org.webjars.npm" name="seleccion" rev="2.0.0">
  <artifact name="seleccion" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='seleccion', version='2.0.0')
)
libraryDependencies += "org.webjars.npm" % "seleccion" % "2.0.0"
[org.webjars.npm/seleccion "2.0.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

seleccion

A getSelection polyfill and a setSelection ranch dressing

Includes also a setSelection method. See also sell to work with selection within <input> and <textarea> elements.

install

npm install seleccion

seleccion.get()

Provides a polyfill for window.getSelection.

var getSelection = require('seleccion').get;
var range = getSelection();
  • Defaults to window.getSelection if available
  • Falls back to document.selection
  • Falls back to a naïve null object if both are unavailable

seleccion.set(range)

Provides a convenient cross-browser method to set the text selection using a range TextRange.

var setSelection = require('seleccion').set;
setSelection({
  startContainer: document.querySelector('#some-span'),
  startOffset: 0,
  endContainer: document.querySelector('#another-span'),
  endOffset: 24,
  collapsed: false
});

license

MIT

Versions

Version
2.0.0