[thelist] DOM - adding a function to a dynamically addedelement...

Pavel Dudrenov dudrenov at gmail.com
Tue Apr 26 02:26:55 CDT 2005


Jeff,

setAttribute() does work for some stuff on IE but you try  to add
onclick, stlye among other things with setAttibute you will fail in
IE. ALso what's wrong with using addEventListener/attachEvent If he
need to get to this ( by this I mean the object that's been clicked
on) he can easily access it from srcElement/target

Pavel
On 4/25/05, Jeff Howden <jeff at jeffhowden.com> wrote:
> Matt,
> 
> ><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> > From: Matt Warden [mailto:mwarden at gmail.com]
> >
> > > This simply isn't true.  setAttribute() works just
> > > fine in IE6+.
> >
> > Are you certain? From my testing, if one tries to set
> > attributes like 'style' using setAttribute rather than
> > the property method, it fails in IE6 (and lower, of
> > course).
> ><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> 
> Ok, true enough.  It does not work properly with complex attributes like
> "style" which is more of an object (internally) and less of an attribute and
> event handlers which I suppose the pedants (myself included) would argue
> aren't really attributes, but something else altogether.
> 
> Everything else does work fine from my experience.
> 
> Jeff
> ——————————————————————————————————————————————————————
> Jeff Howden - Web Application Specialist
> Résumé - http://jeffhowden.com/about/resume/
> Code Library - http://evolt.jeffhowden.com/jeff/code/
> 
> --
> 
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
> 
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !
>


More information about the thelist mailing list