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