উদাহরণ
নিচের কোডটি ইনলাইন JavaScript (onfocus) ব্যবহার করে ফোকাস পেলে ইনপুট ফিল্ডের মান ক্লিয়ার করার পদ্ধতি দেখায়:
<!DOCTYPE html> <html> <head> <h1>Clearing an input field on focus example</h1> <input type="text" onfocus="this.value=''" value="Some random text..."> <h2>Click on the above field to clear its value</h2> </body> </html>
আউটপুট
উপরোক্ত কোড নিচের আউটপুটটি তৈরি করবে:

ফিল্ডে ক্লিক করলে অভ্যন্তরীণ মান ক্লিয়ার হবে:
