document.fm.name.focus() not working in IE

Discussion in 'JavaScript' started by sugarland, Mar 12, 2009.

  1. #1
    I added this javascript in my page to make it first focus on the input box which is named "name".

    <script language="javascript">
    document.fm.name.focus();
    </script>

    It's working in Firefox, but not working in Internet Explorer. What's the problem?
     
    sugarland, Mar 12, 2009 IP
  2. Beaconwebsol

    Beaconwebsol Peon

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Actually it should work. You may try by some other method like
    document. getElementById(id-of-element).focus();
     
    Beaconwebsol, Mar 12, 2009 IP