ok, onfocus is an event you can assign to most elements.
Maybe try something like this:
Code:
<input type="text" id="username" value="" onfocus="alert('test');" />
Then every time you click on the username textbox the alert() will fire.
Or if you prefer to put the javascript in a function you could do this:
Code:
<input type="text" id="username" value="" onfocus="call_a_function();" />
and then either within internal <script type="text/javascript"> or an external JS file you could have
Code:
function call_a_function() {
alert("test");
}
Bookmarks