I would like to find out if the method closest () is supported and if necessary (IE 11) use an alternative in the following form:
ancestor = ('closest' in document.documentElement) ? element.closest (selector) : element.parentElement;
The consoles of my browsers (Edge, Chrome, Firefox, IE 11 - WIN 10) return 'true' or 'false' as expected.
Is this solution a clean solution or are there any pitfalls that I did not consider ?