Поскольку querySelectorAll возвращает коллекцию, вы можете использовать метод forEach в коллекции, чтобы просмотреть каждый элемент и применить необходимую обработку
const show = () => {
let value = document.getElementById('firstname').value;
document.querySelectorAll('.firstname-show')
.forEach(div => div.textContent = value);
}
<input type="text" id="firstname" name="firstname" placeholder="First name">
<button id="firstname-btn" onclick="show()">SHOW</button>
<div class="firstname-show"></div>
<div class="firstname-show"></div>