DOM:Selection:containsNode
From MDC
Contents |
[edit] Summary
Indicates if the node is part of the selection.
[edit] Syntax
sel.containsNode(aNode, aPartlyContained)
[edit] Parameters
aNode- The node that is being looked for whether it is part of the selection
aPartlyContained- When true,
containsNodereturns true when a part of the node is part of the selection. - When false,
containsNodeonly returns true when the entire node is part of the selection.
[edit] Examples
/* Check to see if anything inside the body element is selected */ alert(window.getSelection().containsNode(document.body, true));