كيف - مسح حقل الإدخال
تعرف على كيفية مسح حقل الإدخال عند التركيز.
انقر فوق حقل الإدخال لمسحه:
مسح حقل الإدخال عند التركيز
مثال
<!-- When the input field gets focus, replace its current value with an
empty string -->
<input type="text" onfocus="this.value=''" value="Blabla">
امسح حقل الإدخال باستخدام زر
مثال
<button onclick="document.getElementById('myInput').value = ''">Clear input
field</button>
<input type="text" value="Blabla" id="myInput">
نصيحة: انتقل إلى البرنامج التعليمي لنموذج HTML الخاص بنا لمعرفة المزيد حول نماذج HTML.