JavaScript Edit Nilai Formulir

<input type="text" id="example">
<input type="submit" value="Submit" onclick="document.getElementById('example').setAttribute('value','My default value')">
Engineer Wajid Ali