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