What's Here?
- Members: 300,493
- Replies: 826,149
- Topics: 137,485
- Snippets: 4,420
- Tutorials: 1,148
- Total Online: 1,840
- Members: 79
- Guests: 1,761
|
While trying to make a "reloading" script for use with my transparent HTML/CSS backgrounds I came across a problem with IE. I couldn't use object.getElementsByName()! So I came up with this solution. Granted it's limited to one kind of tag right now, but it should make coding standard (X)HTML a little easier.
|
Submitted By: snoj
|
|
Rating:
 
|
|
Views: 29,529 |
Language: JavaScript
|
|
Last Modified: November 11, 2005 |
Snippet
function getElementsByName_iefix(tag, name) {
var elem = document.getElementsByTagName(tag);
var arr = new Array();
for(i = 0,iarr = 0; i < elem.length; i++) {
att = elem[i].getAttribute("name");
if(att == name) {
arr[iarr] = elem[i];
iarr++;
}
}
return arr;
}
Copy & Paste
|
|
|
|