On Mar 5, 7:32 am, Lee Jenkins <l...@datatrakpos.com> wrote:
> Are there any known problems with writeAttribtue and FF3?  I have a small 
> function:
> function(obj){
>      Element.writeAttribute(obj.elname, obj.attr, obj.newValue);
> }
> It doesn't update the attribute.

How did you determine that? Do you have a test case?

>  I also tried with literal values instead of
> using the object's properties as params.  Setting the value using dot notation
> works however and both the dot notation and writeAttribute works on IE7.

Don't use writeAttribute for attributes defined in HTML 4 for DOM
elements where setting the dot property does the job.  writeAttribute
uses setAttribute which has known differences between browsers (e.g.
when working with form controls, using setAttribute to set the value
attribute will only change the value in IE, Firefox changes both the
value and the defaultValue).

setAttribute is intended to be a general way to set the value of
attributes, not properties.  While it works more or less
interchangeably with the dot property 99% of the time, the few foibles
mean that it's safter to only use it for setting attributes that
aren't standard HTML 4 attributes (and use the dot property for
everything else).

You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to