By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,851 Members | 1,133 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,851 IT Pros & Developers. It's quick & easy.

ie div onclick problem

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.