Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

141
Views
Value of Input field don''t change on button click

if i click on the buttons i see in the console that the value change but the value in the input field don't change so what did i wrong

JS

let Eingabe = document.getElementById("eingabe").value;
let Eins = document.getElementById("ein");
let Zwei = document.getElementById("zwei");
let userinput = "";

console.log("bevor:", Eingabe);

Eins.addEventListener("click", function() {
  userinput = userinput + Eins.innerHTML
  Eingabe = userinput;
  console.log(Eingabe);
})

Zwei.addEventListener("click", function() {
  userinput = userinput + Zwei.innerHTML;
  Eingabe = userinput;
  console.log(Eingabe);

})
<input type="number" id="eingabe" class="input" value="0">
<button id="ein" class="eins taste ">1</button>
<button id="zwei" class="zwei taste">2</button>
<button class="drei taste">3</button>
<button class="null taste">0</button>
<button class="gleich staste">=</button>
<button class="Del staste">DEL</button>
</div>
</div>
<script type="text/javascript" src="script.js"></script>
</body>

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!