Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 72358

What is anchorNode , baseNode , extentNode and focusNode in the object returned by document.getSelection?

$
0
0

If I make a selection in a html page and I do :

var a = document.getSelection()

I get an object with four properties :

  1. anchorNode
  2. baseNode
  3. extentNode
  4. focusNode

the values of first three is the same i.e. the text that I have selected but how are they different and which one to use?


Viewing all articles
Browse latest Browse all 72358

Trending Articles