control-freak-ide/Control-Freak-Documentation/jQuery/docs/entries/jQuery.contains.json
plastic-hub-dev-node-saturn 538369cff7 latest
2021-05-12 18:35:18 +02:00

1 line
1.3 KiB
JSON

{"name":"jQuery.contains","type":"method","title":"jQuery.contains()","deprecated":null,"removed":null,"desc":"Check to see if a DOM element is a descendant of another DOM element.","categories":["utilities","version/1.4"],"entries":[{"return":"Boolean","signatures":{"added":"1.4","argument":[{"desc":"The DOM element that may contain the other element.","name":"container","type":"Element"},{"desc":"The DOM element that may be contained by (a descendant of) the other element.","name":"contained","type":"Element"}]},"examples":{"desc":"Check if an element is a descendant of another.","code":"\n$.contains( document.documentElement, document.body ); // true\n$.contains( document.body, document.documentElement ); // false\n"},"longdesc":"\n <p>The <code>$.contains()</code> method returns <code>true</code> if the DOM element provided by the second argument is a descendant of the DOM element provided by the first argument, whether it is a direct child or nested more deeply. Otherwise, it returns <code>false</code>. Only <em>element</em> nodes are supported; if the second argument is a text or comment node, <code>$.contains()</code> will return <code>false</code>.</p>\n <div class=\"warning\">\n <p><strong>Note:</strong> The first argument <em>must</em> be a DOM element, not a jQuery object or plain JavaScript object.</p>\n </div>\n "}]}