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()
I wonder what's the purpose of using a textbox in this case if the user can never write anything inside. Just add a disabled="disabled"
attribute or readonly="readonly"
(in case you want to post the value).
In HTML:
<input type="text" onfocus="this.blur();" />
In JS:
document.getElementById("input1").onfocus = function () { this.blur(); }
Some elements cannot accept focus without being editable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With