$(document).ready(function(){ $("#barcode span").hover( function () { $(this).addClass("barover"); }, function () { $(this).removeClass("barover"); } ); });