Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

The behavior that Selection.addRange() merges existing Range and the specified Range was removed.

#make sure to call selection.removeAllRanges(), then call selection.addRange(range)
selection = window.getSelection();    
range = document.createRange();
range.selectNodeContents(elem);
selection.removeAllRanges();         
selection.addRange(range);  
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #The #behavior #merges #existing #Range #Range
ADD COMMENT
Topic
Name
5+7 =