my dog learned polymorphism*
The moose likes HTML, CSS and JavaScript and the fly likes Href in a div, i want to action on the whole div ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Href in a div, i want to action on the whole div ?" Watch "Href in a div, i want to action on the whole div ?" New topic
Author

Href in a div, i want to action on the whole div ?

Frank Jacobsen
Ranch Hand

Joined: May 17, 2002
Posts: 348
I try to explain my problem a little better then last time , my A href only fires when im over the actuel text "my href text", i want to fire my A href i the whole div element, is this possible ?



Frank
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Just like the answer in the last post, you need to put the event handler on the div. SO somehow you need to programmatically or manually add the event handler.

Eric
Frank Jacobsen
Ranch Hand

Joined: May 17, 2002
Posts: 348
I dident get an answer on my last post ! But i dident understand the answer:

you need to put the event handler on the div !

I have tryed with an mouse over on the div element, its that what you mean, i have tried to make :

<div onmoouseover="do something">
<div>
< a href "do my href">
</div>
</div>

But there is no mouse over on the whole div, only on the tekst, so where else can i put it ?

Frank
Justin Fox
Ranch Hand

Joined: Jan 24, 2006
Posts: 802
just add onclick event to the div like so...



Hope this helps you out a bit,

Justin Fox


You down with OOP? Yeah you know me!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60822
    
  65

But there is no mouse over on the whole div, only on the tekst, so where else can i put it ?
I have no idea what you mean by "tekst" or by this statement.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Frank Jacobsen
Ranch Hand

Joined: May 17, 2002
Posts: 348
Thanks thats helped me a lot, im only have one problem know, my o nmouseover with the a href have a "hand" when i put the courser in the area where the text is , but the rest off the td i call okay my javasctipt onclick, but there is no hand, is it possible to solve that problem too ?

Frank
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
add css to the div, set the cursor to pointer.

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Href in a div, i want to action on the whole div ?
 
Similar Threads
Problem displaying report using JSP
Displaying JSP in certain DIV tag
Print content inside the div tag
Javascript event handler executes twice
My Access Key Does Not Work