I made a keyboard with html and css. I have a button in it and I want that when I push it, the other buttons change.(for example if it was 3, I want it to be # when I click on the button)
this can be a simple example .
when you push change whole buttons all the buttons will be #.
const simpleButtons = document.querySelectorAll('.simple-button');
const lordButton = document.querySelector('.lord-button');
lordButton.addEventListener('click', () => {
simpleButtons.forEach(item => {
item.textContent = "#";
});
});
.simple-button {
background-color: #6366F1;
color: #ffffff;
padding: 5px 10px;
border: none;
border-radius: 4px;
margin-bottom: 10px;
cursor: pointer
}
<button class="simple-button">3</button>
<button class="simple-button">3</button>
<br />
<br />
<br />
<button class="lord-button">change whole buttons</button>