calculator in js
I want to write a program, when I press button the value button should appear in input field. Like if press 1 the input show 1 similart 2,3 and so one, likewise in a calculator. So what would be the code of area.addEventListener function. Html code <div> <input class="area" type="number"> </div> <div> <button class="one">1</button> <button class="two">2</button> <button class="three">3</button> <button class="four">4</button> </div> JavaScript code const area = document.querySelector(".area"); const b1 = document.querySelector(".one"); const b2 = document.querySelector(".two"); const b3 = document.querySelector(".three"); const b4 = document.querySelector(".four"); area.addEventListener("click", function(){ });