Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Mel Smith" Newsgroups: comp.lang.javascript Subject: Re: Prob with IE8 and getElementsByName() Date: Wed, 12 Jun 2013 08:37:30 -0600 Lines: 56 Message-ID: References: <51b86558$0$6630$9b4e6d93@newsspool2.arcor-online.net> X-Trace: individual.net m7u85zQuqGjKZq0XFtp8iQFU3YAVpjhj1Z3C/Zj6lO46qhN2ou Cancel-Lock: sha1:WWjk7ga9BHKBp4WrCKFjGplvl00= X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-RFC2646: Format=Flowed; Response Xref: csiph.com comp.lang.javascript:20223 "Martin Honnen" wrote in message news:51b86558$0$6630$9b4e6d93@newsspool2.arcor-online.net... > Mel Smith wrote: > >> Using IE8 and the method document.getElementsByName("somename") >> works >> correctly for elements with a 'name' >> >> However, it fails to produce an array of objects for elements. >> >> Is there a workaround for this please ? > > Neither HTML 4 nor HTML5 define a "name" attribute on "td" elements I > think (while of course form controls like "input" elements have such an > attribute). > > So what do you want to achieve? If you want to group some "td" elements > other than by putting them into "tr" elements in the same "tbody" then use > the "class" attribute. In that case getElementsByClassName should help, > although for IE 8 you will need to implement it or use querySelectorAll. Hi Andrew & Martin: Altho, I have four other tables on my page, I now have another and last (up to) 7-row table (with 6 columns) I wish to populate from an Ajax response. I was going to use the the 'name=' clause on the elements of this short table to tell me which column I was going to fill from the AJAX responsetext. This is working perfectly with FF and with Chrome -- but , with IE8, the statement: amarkers = document.getElementsByName("markers"), aratings = document.getElementsByName("ratings"), (etcetera ... for 6 columns) but, the value of amarkers.length --> 0 when it should be from 1 thru approx 7 (rows, that is) Then, I use the objects in the arrays (e.g., amarkers) to populate the table from my Ajax response. I guess I *could* use document.getElementsByTagName("td"), but then I'd have up to 7000 elements to run thru ... I guess I'll 'plant' id="xxxxxx" each each of my 40 or so elements instead. Thanks for the response. -Mel