Visit Mozilla.org

DOM:Selection:containsNode

From MDC

« Gecko DOM Reference

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, containsNode returns true when a part of the node is part of the selection.
When false, containsNode only 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));