focus the element created on the fly

how to focus an element created on the fly

Page 1 of 1

5 Replies - 831 Views - Last Post: 20 November 2010 - 03:57 PM

#1 test.biju  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 15-November 10

focus the element created on the fly

Posted 15 November 2010 - 02:34 AM

how to focus an element, which is created on the fly,(document.getElementById('id').focus() is not working in IE 7)

This post has been edited by test.biju: 15 November 2010 - 02:36 AM

Is This A Good Question/Topic? 0
  • +

Replies To: focus the element created on the fly

#2 MrLuke187  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 81
  • View blog
  • Posts: 237
  • Joined: 09-July 10

Re: focus the element created on the fly

Posted 15 November 2010 - 03:54 AM

What about IE8 e.g. IE9 ?
IE7 is old and shouldn't be used anymore.

Greetings: Luke
Was This Post Helpful? 0
  • +
  • -

#3 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3541
  • View blog
  • Posts: 10,255
  • Joined: 08-June 10

Re: focus the element created on the fly

Posted 15 November 2010 - 04:53 AM

View PostMrLuke187, on 15 November 2010 - 10:54 AM, said:

IE7 is old and shouldn't be used anymore.

IEs update progress is slow, so IE7 is bound to be around for some time.
Was This Post Helpful? 0
  • +
  • -

#4 forest51690  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 58
  • View blog
  • Posts: 340
  • Joined: 20-March 09

Re: focus the element created on the fly

Posted 15 November 2010 - 06:30 AM

Are you sure that document.getElementById("id") exists in the first place? That might be the problem. Try this piece of code:
alert(document.getElementById("id"));
alert(document.getElementById("id").tagName);

Was This Post Helpful? 1
  • +
  • -

#5 test.biju  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 15-November 10

Re: focus the element created on the fly

Posted 19 November 2010 - 03:19 AM

Thanks for the reply...:)


View Postforest51690, on 15 November 2010 - 05:30 AM, said:

Are you sure that document.getElementById("id") exists in the first place? That might be the problem. Try this piece of code:
alert(document.getElementById("id"));
alert(document.getElementById("id").tagName);

Was This Post Helpful? 0
  • +
  • -

#6 husseycoding  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 52
  • View blog
  • Posts: 174
  • Joined: 23-June 10

Re: focus the element created on the fly

Posted 20 November 2010 - 03:57 PM

Believe it or not, people are still using IE6 although it's generally accepted that you can get away without supporting this browser now. IE7 you should definitely still code to support.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1