Safari mousedown event

M

mitch

I have a big <table> and I have added an onmousedown handler.
When I get back the event in IE and Firefox, the individual <td>
element appears in window.event.srcElement (IE) and in
event.target (Firefox). However in Safari the target is just the
<table>, not the <td>.

I need to get back the <td> associated with the event, and I would
not like to put an onmousedown handler on each table cell because
there are a lot of them. Does anybody know how I can get the event
and figure out which table cell was clicked? Thanks.
 
M

mitch

P.S. The exact same thing happens with onmouseclick as
onmousedown on Safari: the event's target is the <table>
rather than the <td>.
 
M

mitch

Sorry to answer my own post (again) but I've found the
fix, at least for the first of my project's Safari problems.
In my table, if a cell is completely empty, the event was coming back
with its target set to the <table> in Safari. If I add an &nbsp;
to the empty table cell, now the mouse events come back
pointing to the <td> element. This is a small difference between
Safari and the other browsers, where the event target is the <td>
element even if the cells are empty.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top