Objective

Redefine the firstElementChild property of the Element interface, manually in JavaScript.

Difficulty

Easy

Description

In the previous HTML DOM — Elements chapter, we learnt about the firstElementChild property of the Element interface.

It returns the first child node of the calling element that is an element itself, or else the value null if there is no element child node in the calling element or just about no child node at all.

In this exercise, you have to redefine firstElementChild on the Element interface, manually in JavaScript.

You MUST only use properties/methods of the Node interface in your code, NOT any properties/methods of the Element interface, such as children.