DOM Manipulation

documentElement

document.documentElement

document.documentElement is the root html element for the current page. It is useful for page-wide attributes such as lang.

This is different from updating a visible paragraph. The language attribute belongs to the document root, while the paragraph is just feedback for the learner.

Your task: Set the document language to en and update the language status text to Language set to en.

Free with a JS Exercises account

Sign in to start coding, run your solution, and keep your progress saved for later. No payment needed.

By continuing, you agree to our Terms and Privacy Policy. We'll send occasional product updates and news. You can unsubscribe anytime.

document.documentElement

document.documentElement is the root html element for the current page. It is useful for page-wide attributes such as lang.

This is different from updating a visible paragraph. The language attribute belongs to the document root, while the paragraph is just feedback for the learner.

Your task: Set the document language to en and update the language status text to Language set to en.

Free with a JS Exercises account

Sign in to start coding, run your solution, and keep your progress saved for later. No payment needed.

By continuing, you agree to our Terms and Privacy Policy. We'll send occasional product updates and news. You can unsubscribe anytime.

Console

Run code to see output.