Files
plastic-hub-dev-node-saturn 538369cff7 latest
2021-05-12 18:35:18 +02:00

1 line
1.5 KiB
JSON

{"name":"descendant","type":"selector","title":"Descendant Selector (\"ancestor descendant\")","deprecated":null,"removed":null,"desc":"Selects all elements that are descendants of a given ancestor.","categories":["selectors/hierarchy-selectors","version/1.0"],"entries":[{"return":"","signatures":{"added":"1.0","argument":[{"desc":"Any valid selector.","name":"ancestor","type":"Selector"},{"desc":"A selector to filter the descendant elements.","name":"descendant","type":"Selector"}]},"examples":{"desc":"Mark all inputs that are descendants of a form with a dotted blue border. Give a yellow background to inputs that are descendants of a fieldset that is a descendant of a form.","code":"\n$( \"form input\" ).css( \"border\", \"2px dotted blue\" );\n$( \"form fieldset input\" ).css( \"backgroundColor\", \"yellow\" );\n","css":"\n form {\n border: 2px green solid;\n padding: 2px;\n margin: 0;\n background: #efe;\n }\n div {\n color: red;\n }\n fieldset {\n margin: 1px;\n padding: 3px;\n }\n","html":"\n<form>\n <div>Form is surrounded by the green border.</div>\n\n <label for=\"name\">Child of form:</label>\n <input name=\"name\" id=\"name\">\n\n <fieldset>\n <label for=\"newsletter\">Grandchild of form, child of fieldset:</label>\n <input name=\"newsletter\" id=\"newsletter\">\n </fieldset>\n</form>\nSibling to form: <input name=\"none\">\n"},"longdesc":"\n <p>A descendant of an element could be a child, grandchild, great-grandchild, and so on, of that element.</p>\n "}],"slug":"descendant-selector"}