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

1 line
957 B
JSON

{"name":"has","type":"selector","title":":has() Selector","deprecated":null,"removed":null,"desc":"Selects elements which contain at least one element that matches the specified selector.","categories":["selectors/content-filter-selector","selectors/jquery-selector-extensions","version/1.1.4"],"entries":[{"return":"","signatures":{"added":"1.1.4","argument":{"desc":"Any selector.","name":"selector","type":"Selector"}},"examples":{"desc":"Adds the class \"test\" to all divs that have a paragraph inside of them.","code":"\n$( \"div:has(p)\" ).addClass( \"test\" );\n","html":"\n<div><p>Hello in a paragraph</p></div>\n<div>Hello again! (with no paragraph)</div>\n","css":"\n .test {\n border: 3px inset red;\n }\n"},"longdesc":"\n <p>The expression <code>$( \"div:has(p)\" )</code> matches a <code>&lt;div&gt;</code> if a <code>&lt;p&gt;</code> exists anywhere among its descendants, not just as a direct child.</p>\n "}],"slug":"has-selector"}