Reputation: 15847
I am building custom buttons(sliding doors) for a new website. The buttons will not trigger a link but a javascript that then submits the form.
My solution is to use div (instead of link) with span within.
The question is if I should use onmouseover/onmouseout or is hover a preferred?
Pleas note : My website demands javascript else it wont work at all, so there is no problem to use javascript for the button, the question is which way that is the most correct?
Upvotes: 0
Views: 800
Reputation: 15847
The solution for this is to simple use onmouseover/onmouseout on the div element. It will generate some code but it will be safe to use even in IE6.
This will ofcource demand javascript but that will have to do.
Upvotes: 0
Reputation: 59
If you are talking about jQuery events, it doesn't matter, it's the same.
If you're talking about HTML onmouseover/onmouseout vs. CSS:hover, go for CSS:hover. It's far easier to maintain, looks cleaner and decreases the size of your HTML which is a mess most times, anyways.
Upvotes: 1
Reputation: 82523
I would do it with CSS because it would require less code and it would work with Javascript disabled
Upvotes: 2