[SOLVED] document.getElementsByTagName

This is a discussion on "[SOLVED] document.getElementsByTagName" within the JavaScript Forum section. This forum, and the thread "[SOLVED] document.getElementsByTagName are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jan 22nd, 2008, 16:25
Junior Member
Join Date: Oct 2007
Location: UK
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
[SOLVED] document.getElementsByTagName

There seems to be 2 ways of accessing elements using this method - document.getElementsByTagName(tag)[0] or document.getElementsByTagName(tag).item(0)

Is one just for HTML, and the other for HTML & XML? Can anyone explain the difference between the two?
Reply With Quote

  #2 (permalink)  
Old Jan 22nd, 2008, 17:01
Rakuli's Avatar
SuperMember

SuperMember
Join Date: Sep 2007
Location: Australia
Age: 24
Posts: 956
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: document.getElementsByTagName

I have not yet noted any differences in these methods. They both work in HTML and XHTML. It is another way to access the array of elements returned by the function.
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
Reply With Quote
  #3 (permalink)  
Old Jan 22nd, 2008, 22:04
Junior Member
Join Date: Oct 2007
Location: UK
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Re: [SOLVED] document.getElementsByTagName

Okay, thanks for the answer.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] popup and document.write problem in IE deluxmilkman JavaScript Forum 3 Oct 3rd, 2007 11:26
document.getElementById and document.getElementByName is not working in FF dhineraj JavaScript Forum 3 Jul 26th, 2007 20:23
can i add word document? monstermunch Starting Out 8 Apr 20th, 2007 16:49
Document Information ClaireB Classic ASP 0 Oct 24th, 2006 17:46
using tables in a css document ivyholly Web Page Design 11 Dec 31st, 2005 18:07


All times are GMT. The time now is 10:42.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43