execCommand
HTML
<input>
<button id="button">OverWrite</button>
JavaScript
'use strict';
button.onclick = function() {
document.execCommand('OverWrite');
}
<input>
<button id="button">OverWrite</button>
'use strict';
button.onclick = function() {
document.execCommand('OverWrite');
}