|
<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
|
|
|
|
My IE doesn't really like it.
|
|
|
|
|
My IE doesn't really like it. ARE YOU SERIOUS?! gah @ IE
|
|
|
|
Yep. You can't use Object or Node in IE. Its a real bitch.
|
|
|
|
|
Yep. You can't use Object or Node in IE. Its a real bitch. You can't use object either?? !!! >_>_>_> blah
|
|
|
|
Yep. You can't use Object or Node in IE. 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).
|
|
|
|
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 Have to be sure about it
|
|
|
|
Too many thinks Have to be sure about it Yeah, I'm pretty sure anything with a constructor can be prototyped to. I forgot to mention that HTMLElement is not crossbrowser .
|
|
|
|
Yeah, we just need to find the constructor. HTMLElement and Element don't work.
|
|
|
|