Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript_howto thread: REVISITED TD HIGHLIGHTING


Message #1 by "Claudio Pallone" <pallone@l...> on Sat, 5 Oct 2002 20:33:24 +0100
Hi Robert and thanks for your comments.

You are right. The code works with Netscape 6.02 but not with IE6. So if 
I use the same id attribute for TDs I will only get a reference to the 
first one?? Why did Microsoft did that??
It is much simpler to use the getElementsByName!!!

Cheers,

Claudio


nice thinking! Your code will work with Netscape 6 and up, but not with
IE.
Why? The reason is that Microsoft (don't ask me why) seem to demand that
for TDs (not INPUTs)=3D20
the element in question must have both the NAME and ID attribute with
the same value.

For example, this will work for you:

<tr>
	<td id=3D3D"ind" name=3D3D"ind"></td>
	<td id=3D3D"ind" name=3D3D"ind"></td>
</tr>


The downside of this is (since an ID is supposed to be unique to an
element), when you use
document.getElementById("ind") in that case, all you will get reference
to is the first element=3D20
in the page that has the "ind" ID.


For more info about Microsoft's implementation, see:
http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/getele
mentsbyname.asp


Does anyone know why it is like this? Is it meant to be like this, or is
it a bug in the Microsoft implementation?


/Robert





BMRB International
http://www.bmrb.co.uk +44 (0)20 8566 5000
____________________________________________________________
This message (and any attachment) is intended only for the recipient and 
may contain confidential and/or privileged material. If you have 
received this in error, please contact the sender and delete this 
message immediately. Disclosure, copying or other action taken in 
respect of this email or in reliance on it is prohibited. BMRB 
International Limited accepts no liability in relation to any personal 
emails, or content of any email which does not directly relate to our 
business.

  Return to Index