Edge Browser missing function Element.closest(selector)

Fixed Issue #10320716


Eric F.
Dec 27, 2016
This issue is public.
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

Every web browser I’ve tested other than MS Edge supports JavaScript statements of the form:
variable = Element.closest(selector)

Example: : var targetElem = this.nodeField.closest(‘div’); // Get field’s closest containing div

Please see: https://developer.mozilla.org/en-US/docs/Web/API/Element/closest

The list of browsers currently supporting this “Living Standard” includes Mozilla, Chrome, and Safari on desktop, iOS, and Androids.

However, executing the above JavaScript statement in MS Edge results in the following error:
SCRIPT438: Object doesn’t support property or method ‘closest’

This forces me to add a conditional function prototype polyfill for “closest” to my application so that it will run successfully on MS Edge, which I would much prefer not to do.


0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “Ibrahim O.”

      Changed Assigned To to “Travis L.”

      Changed Status to “Confirmed”

      Changed Status from “Confirmed” to “Fixed”

    You need to sign in to your Microsoft account to add a comment.

    Sign in