jQuery - parent()

The parent() returns the direct parent element of the selected element. This method only traverses a single level up the DOM tree.

Hello World

 


$("#btnDemo").click(function ()
{
    $("#child").parent().css({ "border-width" : "5px", "border-type" : "solid", "border-color" : "red"});
});