On 8/30/06, John Resig <[EMAIL PROTECTED]> wrote:
> Hmmm.... I guess doing .setAttribute("value","foo") doesn't work?
> Because that's what I changed jQuery to do. I guess I could make a
> special case for that then.

Using `setAttribute` can be tricky, as "IE doesn't propagate changes
made via `setAttribute` to the visual display of an element" [1]
(except for `className` and `style`.

So, if we can identify _all_ the buggy attributes --as `value` seems
to be, the special cases could be added in the same way the other
fixes are (`innerHTML` et al.)

Otherwise, HTML attributes can be set securely through:

    element.setAttribute(attrName, '');
    element[attrName] = value;

By the way, John: May I ask about the second parameter (`2`) passed to
`getAttribute` in line 1276 of rev 234? What does it do?

[1]: From _The Javascript Anthology_, by James Edwards & Cameron Adams

-- 
Choan
<http://choangalvez.nom.es/>

Dizque. Desarrollo web y pequeñas dosis de vida real
<http://dizque.lacalabaza.net>
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to