Code:
$(document).ready(function()
{
bindEvents();
});
function bindEvents()
{
$(".divSample").each(function()
{
$(this).bind("mouseover",addClass);
$(this).bind("mouseout",removeClass);
});
}
function unBindEvents()
{
$(".divSample").each(function()
{
$(this).unbind("mouseover",addClass);
$(this).unbind("mouseout",removeClass);
});
}
function addClass()
{
$(this).addClass("divChanged");
}
function removeClass()
{
$(this).removeClass("divChanged");
}