Every HTML element in DOM has reference to its parent node. With simple iteration it's possible to traverse up to the requested element. If this loop is wrapped within a function, you will get a very useful code.
↧