7 October 2023

You don't have to find the body by tag name. This code will give you a reference to the element of the current HTML document, which you can then manipulate or access as needed in your JavaScript code.

Source code viewer
  1. const bodyElement = document.body;
Programming Language: ECMAScript