473,434 Members | 1,738 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,434 software developers and data experts.

ie div onclick problem

Hi why if I have a DIV I can raise an onclick event only on the inner
DIVs and not
on the whole area? (Firefox does it)

<div id="submenu" class="style1">
<div id="item" onclick="alert(444)">
<div id="a">
AAAAAAAAAa</div>
<div id="B">
bbbbbbbbbb</div>
</div>
</div>

Here the div is height 100px:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! AAAAA |
! bbbbbb |
! . if I click in this empty but rendered area here
the event is not raised!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Any idea?

Thanks
Oct 30 '08 #1
1 8446
On 30 Ott, 12:29, xdevel1999 <xdevel1...@gmail.comwrote:
Hi why if I have a DIV I can raise an onclick event only on the inner
DIVs and not
on the whole area? (Firefox does it)

* *<div id="submenu" class="style1">
* * * * <div id="item" onclick="alert(444)">
* * * * * * <div id="a">
* * * * * * * * AAAAAAAAAa</div>
* * * * * * <div id="B">
* * * * * * * * bbbbbbbbbb</div>
* * * * </div>
* * </div>

Here the div is height 100px:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! *AAAAA * * * * * * *|
! *bbbbbb * * * * * * * |
! * * * * * * * * . if I click in this empty but renderedarea here
the event is not raised!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Any idea?

Thanks
ok a friend of mine give me the answer and I post it so it can be
useful for someone else:

in ie we need to set a background-color so all the area will be
rendered well for
the event

Bye

Oct 30 '08 #2

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

Similar topics

8
by: Shock | last post by:
Hello everyone, I am having a problem with the program below. I have isolated the problem to the onclick event that is located throughout arrQuestions. The onclick event refers to a function...
5
by: Mike | last post by:
In my previous post, I wrote: > ... > GOAL: (very simple) Provide a hyperlink which, when clicked, > calls a javascript function which opens a new URL. > ... > PROBLEM: The following code...
17
by: Mike Gratee | last post by:
Is it possible to use JavaScript to cause the browser to click a link on a page and have the browser act exactly like the user had clicked on the link directly? In other words, I need to...
8
by: KS | last post by:
Just to show some code to show the consept. <img id="date" onclick="javascript:show_calendar();" src="/PlexSysWeb/images/show-calendar.gif" width=20 height=18 border=0> What i want the...
5
by: moondaddy | last post by:
I have a <a> element in a datagrid which wraps some asp.net labels. this element also has an onclick event which does not fire in netscape 6 (and perhaps other browsers for all I know...). Below...
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. ...
7
by: abs | last post by:
Hi everyone. Please, check my test code here: http://skocz.pl/jstest . The trouble is that no matter which span element I click, it alerts '3' and I'm wondering why not '1' for the first span,...
3
by: Michael_R_Banks | last post by:
I'm trying to dynamically build a table that allows users to remove rows when they click a corresponding button. For some reason, whenever I add the button to the table, it never fires the onclick...
2
by: stevemtno | last post by:
I've got a problem with a web page I'm working on. I have 4 modules - one of them has 2 tabs, two of them have 4 tabs. When the user clicks on the tabs, the content below them changes. However, when...
2
by: DavidGeorge | last post by:
In an earlier thread I recounted a problem I was having, but it took a while to reduce the problem to it's basic components and the issue became somewhat confused in reaching that point. I hope you...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.