if ($('#voting4159 > .already-voted').length == 0) { $('#result4159 + a').after('Already voted!'); }