Visit Mozilla.org

Talk:DOM:element

From MDC

Looks great Jesse...thanks for helping out :) dria 04:21, 13 Jun 2005 (PDT)

This may need to be migrated to Gecko DOM Reference:element to satisfy breadcrumbs and case-sensitivity constructs here... Of course migrating 'in-page-content' to Element may also be a solution. I'll leave this to dria (or Jesse) to decide. -Callek 08:33, 13 Jun 2005 (PDT)

Callek is correct about the page title -- I've moved this page now, so it should all work properly. dria 11:03, 13 Jun 2005 (PDT)

Contents

[edit] Things to add

The ToC is not complete, it needs: removeAttributeNS, getAttributeNodeNS, setAttributeNodeNS, getElementsByTagNameNS, compareDocumentPosition, isSameNode, lookupPrefix, isDefaultNamespace, lookupNamespaceURI, isEqualNode, getFeature, setUserData, getUserData to be added (and maybe more). JesseW 22:08, 21 Jun 2005 (PDT)

The links will need to be updated though. --Nickolay 06:10, 18 Aug 2005 (PDT)

Would it make easier reading to replace the references to 'nodes' with 'element' instead, in the TOC descriptions for various node properties?

Eg. changing

lastChild
    Returns the last child of the node. (DOM Core) 

to

lastChild
    Returns the last child of the element. (DOM Core) 

Jabez

[edit] Re: Event Handlers

These element properties cannot be assigned to in the way that the event handlers on the document and window objects can. All of the folllowing event handler properties are read-only, and are made to return the event handling code, if any, that has already been added to the element in the HTML or XML itself.

Is it true? I just tried this code and it worked fine, meaning that clicking on the page resulting in alert box showing:

document.documentElement.onclick = function() {alert(1)}

--Nickolay 06:14, 18 Aug 2005 (PDT)

Yeah that paragraph is totally wrong. I'll fix it. --Maian 00:13, 29 September 2005 (PDT)

[edit] Event descriptions => DOM:event

The event types should be described in detail under DOM:event rather than here, since 1) it's more intuitive and 2) there's another way to add events besides onevent properties/attributes (and even another way if Gecko ever starts supporting the XML Events spec). The onevent properties here could link to them rather than explaining what they do and when they fire. --Maian 02:52, 15 October 2005 (PDT)

This makes sense, but DOM:event is mostly about the event object(s). Maybe create a separate section? --Nickolay 07:56, 15 October 2005 (PDT)
For now, I'm linking to DOM:event:event_name, e.g. DOM:event:keypress. --Maian 08:07, 15 October 2005 (PDT)
Yes, using colon as a delimiter makes perfect sense. Didn't think about that. --Nickolay 08:52, 15 October 2005 (PDT)

[edit] createElement

Why isn't the createElement method included in this list? (s|k 14:05, 7 April 2006 (PDT))

Because it's a method on a document object. Perhaps we should link to that page somewhere. -Nickolay 11:43, 8 April 2006 (PDT)

[edit] onchange

Am I correct that the onchange event should be in the list of events, or is there some reason it doesn't make sense here? Threepointone 18:31, 10 July 2006 (PDT)

I see that onchange is added now, what about: load/onload, select/onselect, and other events listed in DOM Level 2 Events --George3 14:06, 17 October 2006 (PDT)

[edit] dir attribute

This page lists both HTML and XUL elements as having the dir property. While they both do, they don't mean the same thing.

In HTML, dir refers to the direction of the text (left-to-right or right-to-left). In XUL, it refers to the display direction of the children of the element's box, assuming it is a box.

- Enn