How to set the value of HTML input text field in JavaScript

1 Answer

0 votes
<input type="text" id="iid" value="abc" />
const o =  document.getElementById('iid');

o.value = "new value";
  
    
    
    
/*
run:
    
new value
    
*/

 



answered Jun 17, 2021 by avibootz

Related questions

...