Please login or register. Welcome to the Studio, guest!


Quick Links:


newBookmarkLockedFalling

crazynarutard

crazynarutard Avatar

*****
Senior Studio Member

1,470


August 2005
<script type="text/javascript">

Object.prototype.setAttributes = function()
{
   if( this && arguments[0] )
   {
      for( ar = 0 ; ar < arguments.length ; ar ++ )
      {
      arguments[ar].split(/:/)[0].match(/className/i)? this.setAttribute( 'class' , arguments[ar].split(/:/)[1]) : this.setAttribute( arguments[ar].split(/:/)[0], arguments[ar].split(/:/)[1] );
      }
   }
}

</script>

How to use it:
document.getElementsByTagName("td")[5].setAttributes( 'className:bordercolor' , 'align:right' );


Last Edit: Nov 8, 2005 22:08:31 GMT by crazynarutard

Chris

Chris Avatar

******
Head Coder

19,519


June 2005
My IE doesn't really like it. :P

crazynarutard

crazynarutard Avatar

*****
Senior Studio Member

1,470


August 2005
cddude229 said:
My IE doesn't really like it. :P

ARE YOU SERIOUS?!

gah @ IE

Chris

Chris Avatar

******
Head Coder

19,519


June 2005
Yep. You can't use Object or Node in IE. :P Its a real bitch.

crazynarutard

crazynarutard Avatar

*****
Senior Studio Member

1,470


August 2005
cddude229 said:
Yep. You can't use Object or Node in IE. :P Its a real bitch.

You can't use object either?? !!! >_>_>_>

blah :( :'(

Eric

Eric Avatar



1,442


November 2005
crazyj said:
cddude229 said:
Yep. You can't use Object or Node in IE. :P Its a real bitch.

You can't use object either?? !!! >_>_>_>

blah :( :'(
I think you can use object (new Object()), but what you need is an HTMLElement (I think).

crazynarutard

crazynarutard Avatar

*****
Senior Studio Member

1,470


August 2005
eric said:
crazyj said:

You can't use object either?? !!! >_>_>_>

blah :( :'(
I think you can use object (new Object()), but what you need is an HTMLElement (I think).

Too many thinks :P Have to be sure about it :P

Eric

Eric Avatar



1,442


November 2005
crazyj said:
Too many thinks :P Have to be sure about it :P
Yeah, I'm pretty sure anything with a constructor can be prototyped to. I forgot to mention that HTMLElement is not crossbrowser :P.

Chris

Chris Avatar

******
Head Coder

19,519


June 2005
Yeah, we just need to find the constructor.

HTMLElement and Element don't work. :P

newBookmarkLockedFalling