473,320 Members | 2,107 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

onCLick on TD only works on image inside TD

I have an onClick on a TD. If I click on an image inside the TD, the
onClick fires, however if i click anywhere else inside the TD nothing
happens.

Any ideas?
Jul 23 '05 #1
2 2090
TnaG wrote:
I have an onClick on a TD. If I click on an image inside the TD, the
onClick fires, however if i click anywhere else inside the TD nothing
happens.

Any ideas?


<table>
<tr>
<td onclick="alert('hi');"><img src="about:blank"><span>Some
text</span></td>
</tr>
</table>

Tested and working here. If you click "Some text" in IE6SP1, Firefox
0.9.2 and Opera 7.52, the alert() appears.

Perhaps you could provide a URL or the smallest amount of code that
demonstrates this problem. Describe what browsers it is failing in and
what, if any, errors are occurring in those browsers.

Sometimes just breaking the problem down into the smallest reproducible
amount of HTML and Javascript reveals the source of the problem. For
example, you may have a DIV or other element on top of the table cell,
and the only part of the table cell actually exposed to the mouse is the
image.

--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #2
TnaG wrote:
I have an onClick on a TD. If I click on an image inside the TD, the
onClick fires, however if i click anywhere else inside the TD nothing
happens.

Any ideas?


Any source code? What user agent(s) have you tested with?
PointedEars
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Rob Manger | last post by:
Hi All, I am hoping someone can help me. I am trying to setup my main page so that when the user moves the mouse over an image, it changes the source (got this working). When the user CLICKS...
6
by: Cockroach | last post by:
Hello, I have a problem where the onClick of a table row will activates a window.location event, and inside a cell in that row, an image onClick event shows/hides a div. The problem is that...
0
by: Diane Yocom | last post by:
I'm very new to ASP.Net and probably jumped in a little over my head, but... I'm trying to create a user control that will control navigation through my site. It's sortof like Amazon.com, where...
7
by: Tim::.. | last post by:
Can someone please tell me how i execute an onClick event in an asp:Image tag! I want to do the following! Thanks! <asp:Image runat="server" ID="ibtnExpandResource"...
3
by: Siah | last post by:
Hi, I have table with many rows indicating my record. I want my rows to load my record, so I attached an onClick event to every row that loads the proper record. Now, there are options...
11
by: GaryB | last post by:
Hi Guys, I've been battling with this one for hours - I hope that you can help me! My code modifies the <aon a page, from a standard document link into a link with a tailored onclick event. ...
1
by: webdeveloper | last post by:
An onclick event that activates two functions: one that expands a menu, another that swaps an image in the same menu hierarchy; in FF, only one click is required to both swap the image and expand...
2
by: Miroslav Stampar [MCSD.NET / Security+] | last post by:
Does anybody have an idea how to call CGI on a onclick event when link is clicked. This is a sample that works in some situations but sometimes new page loading is to fast. <a...
1
by: sourcie | last post by:
I am changing an existing quiz found on "JavaScriptKit.com Multiple Choice Quiz" I have an image. Instead of using the radio buttons with the normal true/false question, I want to place two...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.