Users Pricing

articles

Home Articles Implementing onfocus event in java script – MindStick

Implementing onfocus event in java script

Anonymous User 9342 15 Mar 2011 Updated 07 Sep 2019

onfocus () event of control trigger java script function as well as control get in focus that means are comes in use. In this demonstration we learn that how to use onfocus () event in java script.

Write down following code in the body section of html document
<form id="ff1">
        <input type="text" id="txtFocusEvent" onfocus="alert('Textbox control got focus.')" />
</form>
Output of the above code snippet is as follows

As soon as user click on text box control for writing some text then an alert window is displayed with a message that Textbox control got focus.

Implementing onfocus event in java script

After clicking on text box…

Implementing onfocus event in java script



I am a content writter !


1 Comments


Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md