jQuery Tutorial
jQuery Tutorial jQuery Introduction jQuery Installation jQuery Syntax jQuery Selectors jQuery Events
jQuery Effects
jQuery Hide/Show jQuery Fade In/Out jQuery Slide jQuery Animation jQuery Stop Animation jQuery Callback jQuery Chaining
jQuery HTML
jQuery Capture jQuery Set jQuery Add Elements jQuery Remove Elements jQuery CSS Classes jQuery css() Method jQuery Dimensions
jQuery Traversal
jQuery Traversal jQuery Ancestors jQuery Descendants jQuery Siblings jQuery Filtering
jQuery Ajax
jQuery AJAX Introduction jQuery load() Method jQuery get()/post() Method
jQuery Others
jQuery noConflict() Method jQuery JSONP
jQuery Examples
jQuery Reference Manual
jQuery Selectors jQuery Event Methods jQuery Effect Methods jQuery HTML / CSS Methods jQuery Traversal Methods jQuery AJAX Methods jQuery Miscellaneous Methods jQuery Properties
jQuery Plugins
jQuery Validate jQuery Cookie jQuery Accordion jQuery Autocomplete
jQuery :parent Selector
Instance
Select each <td> element that is a parent (contains at least one child element or text):
$(document).ready(function(){
$("td:parent").css("background-color","yellow");
});
Definition and Usage
The :parent selector selects all elements that are the parent of another element, including text nodes.
Tip: This selector is the opposite of :empty.
Note: An element is considered a parent if it contains at least one child element (including text).
YouTip