Closed Bug 120522 Opened 24 years ago Closed 24 years ago

HTML Event SPAN onclick handler does not fire

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: bc, Assigned: joki)

Details

Attachments

(4 files)

HTML Event SPAN onclick handler does not fire DOM 2 Event SPAN onclick handler fires Steps to reproduce: Create a SPAN containing a text node Assign a click event handler to an HTML Span Element via elm.onclick = handler; Click on the text contained in the SPAN. Expected results: click handler fires Actual results: click handler does not fire. Reproducible: Everytime Note: If you used the DOM 2 Event method elm.addEventListener to add the event handler to the SPAN, then the handler will fire when the SPAN is clicked.
Does not fire click handler in Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.7+) Gecko/20020111
Does fire click handler in Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.7+) Gecko/20020111
Um, isn't |object.onclick = 'doevent';| supposed to be |object.onclick = doevent;| (i.e. no quotes around |doevent|)? :-) This testcase works: <html> <body> <span id='s'>SPAN Tag</span> <script> function foo() { alert('foo'); } document.getElementById('s').onclick = foo; </script> </body> </html> Marking WORKSFORME, please reopen if there's more to this than what I've seen...
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → WORKSFORME
doh. my bad.
QA Contact: madhur → rakeshmishra
QA Contact: rakeshmishra → trix
Component: Event Handling → User events and focus handling
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: