I have a field and a button.
On pressing the button the field must be populated with some data and an alert message should be displayed. Why is this simple HTML and JS is not working? Alert message is working but the field is not populated.
<input
id="sample-field"
name="sample-field"
type="text"
/>
<br>
<br>
<button
type="button"
id="process-data"
onclick="
document.getElementById('sample-field').innerHTML = 'Hello';
alert('Hello');"
>
Process Data
</button>