get button with text code example
Example 1: get button text javascript
document.querySelector("button .button-class").innerText();
Example 2: how to get button text in javascript
To get button text inside its tag name
document.querySelector("button .button-class").innerText();
To get button text inside its tag name