var label = document.getElementById("label1");
Once we have selected the label, we can change its text by setting the innerHTML property of the label to the new text. For example, if we want to change the label text to "New Text", we can do this:
label.innerHTML = "New Text";
It's that simple! You can use this technique to dynamically change the label text based on user input or other events on your website.