Learn how to clear an input field on focus.
Click on the input field to clear it:
<!-- When the input field gets focus, replace its current value with an empty string -->
<input type="text" onfocus="this.value=''" value="Blabla">
Try it Yourself »
<button onclick="document.getElementById('myInput').value = ''">Clear input field</button>
<input type="text" value="Blabla" id="myInput">
Try it Yourself »
Tip: Go to our HTML Form Tutorial to learn more about HTML Forms.
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!