why isn't this working?

$('body').find(".overcolor").click(function(){
	alert("hi");
});
Member Avatar for stbuchok

just out of curiousity, why not do this:

$('.overcolor').click(function(){
	alert("hi");
});

However if you are adding elements dynamically, this won't work, use this instead:

$('.overcolor').live('click', function(){
	alert("hi");
});
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.