I created a textbox and wrote onfocus="getFocus()"
Now I wrote function in javascript
function getFocus()
{
alert('Hello I Got Focus !!');
}
The problem is in IE8 it worked perfectly, but in IE9 alert is not showing.
Can anyone tell what is wrong with the code ??
I also tried
txtAmt.Attributes.Add("onfocus","getFocus()")
but still it didn’t worked
i too tried
txtAmt.Attributes.Add("onfocus","javascript:getFocus();")
Now i am worried.. what to do ??
Open up the IE developer tool (F12) after your page is loaded.
Check the Browser Mode: and Document Mode:
Try setting Browser Mode to IE9, and Document Mode to IE9 Standards.
Now try again and see if that works.