What is the proper way to add a text to a button?
Here are 3 different ways and all of them works. But I suspect there should be only a single the most correct one. Which one of them?
const button1 = document.createElement('button');
const textForButton1 = 'btn1';
button1.append(textForButton1);
document.querySelector('div').append(button1);
const button2 = document.createElement('button');
const textForButton2 = document.createTextNode('btn2');
button2.append(textForButton2);
document.querySelector('div').append(button2);
const button3 = document.createElement('button');
button3.innerText = 'btn3';
document.querySelector('div').append(button3);
<div></div>