Indicates if the node is part of the selection.
- The node that is being looked for whether it is part of the selection
containsNodereturns true when a part of the node is part of the selection.
containsNodeonly returns true when the entire node is part of the selection.
/* Check to see if anything inside the body element is selected */ alert(window.getSelection().containsNode(document.body, true));