whups, meant to cc the list, although as Emmanuel said this is somewhat OT...
On 6/13/07, Emmanuel <email@hidden> wrote:
2/ I don't know a circumstance where getAttribute would be needed
instead of [blah] or .blah. If you know one, please tell me.
Well, "className" is such an example. The DOM methods are for
arbitrary XML documents, not just HTML. So if you had, say, a college
schedule DTD with something like this:
<course className="Calculus" classNumber="2" ...>
then neither course.className nor course['className'] would work (they
would look for a "class" attribute instead of the "className" one).
Other than that, I think obj[attr] will work in all cases. There are
many examples where obj.attr won't work, though.