selection-extra
selection-extra
Introduction
helpers
React input onSelect
Ref input addEventListener selectionChange
Ref textarea addEventListener select
hello world
React input restore selection
reselection
longer value
reset value
print selection
input
selection with input
Ref contenteditable div addEventListener selectionChange
hello world
React contenteditable restore selection
hello world
reselection
add before
print selection
contenteditable
selection with contenteditable
Ref non-contenteditable div addEventListener selectionChange
hello world 111
React non-contenteditable restore selection
hello world 222
reselection
add before
print selection
non-contenteditable
selection with non-contenteditable
non-contenteditable
container
foo
bar
hello world
contenteditable
container
foo
bar
hello world
non-contenteditable
selection text
selection text with [0, 2]
*selection text with [2, 2]
selection html element
selection html element with [1, 2]
selection input
selection input with [0, 2]
*非 contenteditable 容器 range start/end 值相等时无效果
contenteditable
selection text
selection text with [0, 2]
selection text with [2, 2]
selection html element
selection html element with [1, 2]
selection input
selection input with [0, 2]
print selection
selectNode
select any node