The Vanilla JS equivalent of jQuery's text() method would be to set the textContent property of a DOM element.
The primary use of JavaScript is to write functions that are embedded in or included from HTML pages and that interact with the Document Object Model (DOM) of the page.