Once a reference to an element is gained by use of a method like getElementById or querySelector, there is the parentElement property of the elements parentElement if it has one.
In the event that the element does not have a parent element, or the parent element is not a DOM element the property will have a value of null. This might be desired in some cases as the value of null will evaluate to false and can then be used as a way to break out of looping for example. In the event that the node is not a DOM node it will return null, this would make sense because the name of the property is indeed parent element, so if the parent is not a DOM Element, but some other kind of node then it should return false. If for some reason I want to use another property that will work with nodes in general then there is the parent node property.
Another option is the parent node property, this works in more or less the same way as parentElement but with one note worthy difference. If there is a non DOM element node of sorts it will give that in place of what would otherwise be a null value.
So for now I am not aware of any native browser method that can be used to get all the parent elemets of a given element, but it is not to hard to write one. The solution I put together for this in a flash just involves looping until the current parentNode equals the document. For each loop that the current parent node is not the document just keep pushing the parent node to an array and then return the array once the looping has finished.
So a realted topic of interest when it comes to getting parent elements is the subject of event bubbling. When an element is clicked for example it will fire an on click event that is set for that element, but it will also bubble up to the top most parent element and fire event handlers all the way up unless this is stopped.
So When it comes to event handers the target property of the event object will refer to the element where the event happened and the current target property will refer to the element where the event handler is attached.
As of this writing there is no css selector that I know of that can be used to get a parent element, so there is no way of getting a parent element with querySelector. There is of course chatter about possible future selectors and pseudo classes that might be a way to do so, but so far nothing solid or well supported.