What's Here?
- Members: 244,063
- Replies: 692,841
- Topics: 113,101
- Snippets: 3,863
- Tutorials: 935
- Total Online: 1,382
- Members: 92
- Guests: 1,290
|
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: 26,333 |
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
|
|
|
Be Social
Programming
Web Development
Reference Sheets
Bye Bye Ads
Monthly Drawing
Top Contributors
Top 10 Kudos This Month
|