Sunday, June 2, 2024
 Popular · Latest · Hot · Upcoming
189
rated 0 times [  193] [ 4]  / answers: 1 / hits: 78661  / 14 Years ago, tue, december 14, 2010, 12:00:00

I'd like to know how i can render a div clickable (like a link, with the small hand when i go over with the mouse).



I have some elements like this:



<div class=teamSelector>Some</div>


With this jQuery:



$('.teamSelector').click(function() { 
// some functions
});


Cheers


More From » jquery

 Answers
157

You've already made it clickable in your example. If you would like it to "look" clickable, you can add some CSS:


.teamSelector { cursor: pointer; }

Or continuing with jQuery:


.click(function() { do something }).css("cursor", "pointer");

Here is the W3 schools reference for the cursor property.


[#94605] Sunday, December 12, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
pranavrorys

Total Points: 466
Total Questions: 87
Total Answers: 115

Location: Barbados
Member since Sun, Nov 27, 2022
2 Years ago
pranavrorys questions
Fri, May 27, 22, 00:00, 2 Years ago
Thu, Oct 28, 21, 00:00, 3 Years ago
Sat, May 30, 20, 00:00, 4 Years ago
Fri, Dec 20, 19, 00:00, 5 Years ago
;