I will try to re explain the situation: I have a paragraph there are 72 words, and they have a toggleClass and these words are highlighted for the user and have a cursor. When any word is clicked I want to check the check mark according to that. So there is 72 check marks each has one.
//adding to 72 paragraph words a toggle class
$(".question_text span").click(function() {
$( this ).toggleClass( "green" );
});
//gives id to every 72 words in the paragrapgh
$('.question_text span').each(function(idx) {
$(this).attr('id', 'a' + idx);
});
// checkmarks have id #Q15v2_1 to #Q15v2_72
So i want when the first word of the highlighted ones clicked to check check marik #Q15v2_1 when the second one is clicked #Q15v2_2 and so on, but when the word is uncliked the check-mark becomes unchecked