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)
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.
| Reporter | ||
Comment 1•24 years ago
|
||
| Reporter | ||
Comment 2•24 years ago
|
||
| Reporter | ||
Comment 3•24 years ago
|
||
Does not fire click handler in
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.7+) Gecko/20020111
| Reporter | ||
Comment 4•24 years ago
|
||
Does fire click handler in
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.7+) Gecko/20020111
Comment 5•24 years ago
|
||
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
| Reporter | ||
Comment 6•24 years ago
|
||
doh. my bad.
Updated•24 years ago
|
QA Contact: madhur → rakeshmishra
Updated•23 years ago
|
QA Contact: rakeshmishra → trix
Updated•7 years ago
|
Component: Event Handling → User events and focus handling
You need to log in
before you can comment on or make changes to this bug.
Description
•