How do you get the parent element of a selected element using jQuery?
Description : Use the .parent() method to get the immediate parent of a selected element.
Answer :
To get the parent element of a selected element using jQuery, use the `.parent()` method. For example,`$('#elementId').parent();` returns the immediate parent of the element withID`elementId`. If you want to get all ancestor elements up the DOM tree, use `.parents()` instead. The `.parent()` method is useful for traversing the DOM and applying operations to the parent element directly.