Javascript8
**prsntly links r nt wrking

Events

«<Javascript7|Javascript9»>

focus

  • onblur

This event occurs when objects loses the focus. When we move to other object and looses one object the first object is called blurred or lost focus. In javascript we can program this loosing focus using the onblur event.

  • onfocus

This event occurs when objects receives the focus. When we start working with an object that object gets focus. Whether we click on that object or type in it the focus remains on that object. We can program this onfocus event when the focus is brought on the object specified with this event.
Example
samplecode

<html>
<head>
<title>events - focus</title>
</head>
<body bgcolor=white text="blue">
<h3 align=center>
<u>In this example we used Javascript with in inverted quotes </u>
</h3>
<h4 align=center> just type text in text boxes and click on button</h4>
Name :<input type="t1" name="t1" id="tt1"

onFocus="alert('U cant write here')"

> <br>
Addr : <input type="text" name="t2" id="tt2"

onblur="document.all.tt2.style.background='green';
document.all.tt2.style.color='red'"

> <br>
<input type="button" value="Hit me" name="b1"

onblur="document.bgColor='pink'"

>
</body>
</html>

click focus 2 view result of above programme…
[Top]

Click

  • onclick
  • ondblclick

[Top]

Key movements

  • onkeypress
  • onkeyup
  • onkeydown

[Top]

loading

onload
onunload

[Top]

mouse movements

  • onmousedown
  • onmousemove
  • onmouseout
  • onmouseover
  • onmouseup

[Top]

others

  • onreset
  • onresize
  • onselect
  • onsubmit

[Top]

«<Javascript7|Javascript9»>

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.