JavaScript jQuery each element in given div with class jquery each element with class,jquery each element with data

Try

$(document).ready(function() {
    var score;
    score=0;
    // Mechanizm zaznaczania odpowiedzi
    $('.odpowiedz').click(function() {
        // Najpierw odznacz zaznaczone odpowiedzi
        $(this).closest('.pytanie').find('p.odpowiedz').css('background-color','white');
        // Zaznacz tę odpowiedź
        $(this).css('background-color','blue');
    });
    //Mechanizm sprawdzania
    $('#btn-sprawdz-1').click(function() {

    });

});

Demo: Fiddle

Answer:1

Working FIDDLE Demo

You must get all .odpowiedz in the current question, for this go up to your .pytanie and then select all .odpowiedz:

$(this)
    // go up the dom to the current question
    .closest('.pytanie')

    // and now find all possible answers
    .find('.odpowiedz')

        // and make them white
        .css('background-color', 'white');
Answer:2

This fiddle will set the clicked .odpowiedz in the current div to a blue background.

$('.odpowiedz').click(function () {
    // Najpierw odznacz zaznaczone odpowiedzi
    $(this).parent().find(".odpowiedz").css('background-color', 'white');
    // Zaznacz tę odpowiedź
    $(this).css('background-color', 'blue');
});
Answer:3

Does anyone know if there's a way to add text into the tumblr ask box when the page is first loaded? I'm running a blog where people can ask for advice from either a girl or a guy. I want them to ...

Does anyone know if there's a way to add text into the tumblr ask box when the page is first loaded? I'm running a blog where people can ask for advice from either a girl or a guy. I want them to ...

  1. insert text into pdf
  2. insert text into excel
  3. insert text into picture
  4. insert text into imovie
  5. insert text into excel formula
  6. insert text into photo
  7. insert text into cell vba
  8. insert text into photoshop
  9. insert text into excel cell
  10. insert text into a shape in word
  11. insert text into string python
  12. insert text into word document
  13. insert text into picture in word
  14. insert text into equation latex
  15. insert text into video
  16. insert text into premiere
  17. insert text into image
  18. insert text into file linux
  19. insert text into pdf free
  20. insert text into html

I need to validate number that use inputs into input box. Number must be exactly 12 characters long and start with 931. var reg = /^931[0-9]$/; var val = $("#sms_number").val(); if (val.length === ...

I need to validate number that use inputs into input box. Number must be exactly 12 characters long and start with 931. var reg = /^931[0-9]$/; var val = $("#sms_number").val(); if (val.length === ...

  1. validate jquery regex
  2. jquery validate regex rule
  3. jquery validate regex pattern
  4. jquery validate regex special characters
  5. jquery validate regex example
  6. jquery validate regex email
  7. jquery validate regex password
  8. jquery validate regex not working
  9. jquery validate regex message
  10. jquery validate regex method
  11. jquery validation regex phone number
  12. jquery validation regex alphanumeric
  13. jquery validation regex check
  14. jquery validation regex number
  15. validate url jquery regex
  16. form validation jquery regex
  17. custom validation jquery regex
  18. date validation jquery regex
  19. jquery validate space regex
  20. jquery validate url regex without http

I use pywebkit and html5 to develope desktop map server. Map tiles store in sqlite database. So when I set html img's src, I have two options. One is read image from database and b64encode it, ...

I use pywebkit and html5 to develope desktop map server. Map tiles store in sqlite database. So when I set html img's src, I have two options. One is read image from database and b64encode it, ...

I'm working on a Backbone application and I'm not sure if the way what I'm trying to do is the correct way. I have an application view and inside that application view I'm trying to append a ...

I'm working on a Backbone application and I'm not sure if the way what I'm trying to do is the correct way. I have an application view and inside that application view I'm trying to append a ...

  1. backbone js nested views