0
Write inside input using JS
Can someone explain how to write inside an html input using javascript function onclick Ex <input type=text id=number> <input onclick="calculate()" type= "submit"> Now i want to write something inside the input form with id number if someone clicks on submit. What should the function calculate be then?
1 Answer
+ 5
//Here by getting input field by id and changing input field value.
function calculate(){
document.getElementById('number').value='hello'
}
https://code.sololearn.com/W0aZOm4Cj1fq/?ref=app