Closed Bug 263436 Opened 20 years ago Closed 15 years ago

DOM Ref: Event Handler Properties documentation flawed

Categories

(Documentation Graveyard :: Web Developer, defect)

All
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: bugzilla, Unassigned)

References

()

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040113
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040113

In the Gecko DOM Reference check the DOM _Element_ Reference:

http://www.mozilla.org/docs/dom/domref/dom_el_ref.html#1022767

If you scroll down you'll find the description of possible Event Handlers for an
HTML element, e.g. "onclick". There's also a link to an example:

http://www.mozilla.org/docs/dom/domref/dom_el_ref63.html

It states:
  p.onclick = "alert('moot!');";

I think that's plain wrong. You can not assign a string to an event handler but
only a function reference. Thus it should rather read 

 p.onclick=function() {
        alert('moot!');
}

Additionally, on the DOM _Element_ Reference page, the event handler property is
said to be read only. Thats also wrong. And the example - albeit it does not
work - contradicts this.


Reproducible: Always
Steps to Reproduce:
1. Open the DOM Ref documentation page.
2. Read about Event Handler properties.
3. Try the example.
4. Wonder, why the code does not work on any browser.
Fixed 

https://developer.mozilla.org/en/DOM/element.onclick
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.