'Can i somehow insert number multiple times into input? [closed]
this code while i click two times: 2
what i need: 11
<div id='one'></div>
<input type="number" id='pin'/>
<script>
document.getElementById('one').onclick = document.getElementById('pin').setUp(1);
</script>
Solution 1:[1]
<div id='one'></div>
<input type="number" id='pin'/>
<script>
var one = document.getElementById('one');
var pin = document.getElementById('pin');
one.onclick = function(){
pin.value = pin.value + '1';
}
</script>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Daniel |
