1 Replies - 775 Views - Last Post: 04 July 2013 - 06:29 AM

#1 naash  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 115
  • Joined: 26-August 07

document.getElementById() vs document.forms[0]

Posted 04 July 2013 - 06:16 AM

Difference between document.getElementById() and document.forms[0] ?
I have been using both interchangeably....is there any difference ?
Is This A Good Question/Topic? 0
  • +

Replies To: document.getElementById() vs document.forms[0]

#2 Dormilich  Icon User is online

  • 痛覚残留
  • member icon

Reputation: 3550
  • View blog
  • Posts: 10,323
  • Joined: 08-June 10

Re: document.getElementById() vs document.forms[0]

Posted 04 July 2013 - 06:29 AM

Quote

is there any difference ?

1) one is part of the DOM API, the other of the HTML API

2) try using document.forms for non-form elements ...

This post has been edited by Dormilich: 04 July 2013 - 06:29 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1