This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Mastering Corda: Blockchain for Java Developers and have Jamiel Sheikh on-line!
See this thread for details.
Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

On mouse over / On click events

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I am trying to code a html page which is compatible across browsers.

have a look at the code


Pardon me for the coding standards..
Basically my header of the table will contain a link. I planned to make the whole header "clickable".
so on mouse over I change my cursor to hand and then keep an onclick event so that I can navigate to the url.


Now I tested this in

Fire Fox(2,3) : work's fine.
IE (6,7,8): Refuses to behave in the desired fashion.

I did read about this problem, but I was unable to figure out.

I also tried onmouseover instead of onMouseOver, onclick instead of onClick.

Kindly advise on the event handling.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should not use setAttribute for setting events, an event handler is not an attribute.

Here is how you should add an event if you are not using a library such as jQuery
http://www.scottandrew.com/weblog/articles/cbs-events


BUT there is a better solution, no JavaScript is needed



Pure old CSS


Eric
 
sumanth kadaba
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Eric,

Yes the CSS technique is there

Will try getting it done in script too.

Thanks,
Kadaba
 
reply
    Bookmark Topic Watch Topic
  • New Topic