Santhosh Santhosh - 1 year ago 113
Javascript Question

textbox focus out

I need to focus out from the textbox when it focus in.

I try to set focus for outer div and its working fine in IE but not in mozilla.

How do I do this?

This is my current code:

<div id="outer"> <input type = "textbox" /></div> Onfocus: document.getElementById("outer").focus()

Answer Source

I have tried all the answers and not worked in all the browsers. And I combined all together in to it.

  1. TextBox.readonly = true;


  1. var curText = TextBox.value; TextBox.value = ""; TextBox.value = curText;

  2. TextBox.blur();

  3. TextBox_Parent.focus()

And its working fine in all the browsers

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download