xxxxxxxxxx
<div class="p-2">
<button class="btn" id="button1" onclick="changeContent(button1)">Click Me!</button>
<button class="btn" id="buttonID">Change my text!!!</button>
</div>
<script>
// define the function to change the HTML content
function changeContent(item)//where item is the button you click (ID)
{
document.getElementById('buttonID').innerHTML = item.innerText;
//changes the main button to the text of the item you selected
}
</script>
xxxxxxxxxx
<input onclick="change()" type="button" value="Open Curtain" id="myButton1"></input>
xxxxxxxxxx
var btn = document.getElementById("mybtn");
btn.value = 'my value'; // will just add a hidden value
btn.innerHTML = 'my text';