View Full Version : Hand on hover of javascript onclick link

05-21-2015, 03:46 PM
Is there a way to have a javascript onclick link, thusly

<script>function imageClick(url) {
window.location = url;


show the normal link hover element (pointing hand) for the cursor when the onclick link is hovered?

05-21-2015, 04:13 PM
nevermind. solution was
.roundabout-in-focus {
cursor: pointer;

doh. :D

05-21-2015, 04:18 PM
You could (also) do:

function imageClick(url)
window.location = url;

<a href="javascript: void(0)" onclick="imageClick('http://yahoo.com'); return false">yahoo</a>

05-21-2015, 04:36 PM
thanks. well the problem i was having is that it is an image link in a 3d image carousel that would not let me use normal link html to make the image an image link, so i had to use the javascript onclick thing which doesn't generate a pointer cursor on its own.

05-21-2015, 05:27 PM
I see. You could do <img style="cursor: pointer" onclick=...>, but your solution works fine too (and is better).