bharath kuamr Reddy
asked on
Autofocus not working in ie11
when i put one div tag then i set autofocus on that div after that when i press the button then focus not going on that div.in mozilla and chrom all are working fine
ASKER
Not working in IE
Show us some code that demonstrates the problem.
ASKER
when i put one div tag then i set autofocus on that div after that when i press the button then focus not going on that div.in mozilla and chrom all are working fine
MyCode
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- --
<div id="error_msg" class="error_text margin_px"></div>
in my Js file
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ----
var element = document.getElementById("e rror_msg") ;
setTimeout(function () { element.focus(); }, 10);
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- --------
The above code not working in IE when i click button focus is not going to that div
MyCode
--------------------------
<div id="error_msg" class="error_text margin_px"></div>
in my Js file
--------------------------
var element = document.getElementById("e
setTimeout(function () { element.focus(); }, 10);
--------------------------
The above code not working in IE when i click button focus is not going to that div
That's really not enough. I can't make a test page out of that that will do anything in Firefox. With just that, you can't even tell if the 'focus' has moved to the 'div'.
ASKER
Then Please let me know How can i do that one.I am getting this last issue last two days.
This page http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_html_blur and this page http://www.w3schools.com/cssref/tryit.asp?filename=trycss_sel_focus work fine in IE11.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Can you please justify the grade.
FYI:
http://support.experts-exchange.com/customer/portal/articles/481419-what-grade-should-i-award-
FYI:
http://support.experts-exchange.com/customer/portal/articles/481419-what-grade-should-i-award-
Open in new window
Also, if you are calling focus() dynamically, try calling it from within a setTimeout() -ex:
Open in new window
where element is a node reference to the div in question