The Vanilla JS equivalent of jQuery's text() method would be to set the textContent property of a DOM element.
Source code viewer
// Get text content. const textContent = window.document.querySelector('.my-class-name').textContent; // Set text content. window.document.querySelector('.my-class-name').textContent = 'Hello, world!';Programming Language: Javascript