Hello everyone,
I am newbie with javascript.
i want to make mini game quiz. But stuck on this logic.
Try see my code below,
I want to replace div ID “wrong-gameOne” with div ID “correct-gameOne”
after click all div ID wrong1, wrong2, wrong3, wrong4,
I have try make it, but after click one ID “wrong 1” or other, div ID “correct-gameOne” is show. I don’t want like this.
Please give me fix my script below how to make it.
Sorry for my bad english.
Thanks so much
Script :
$(function () {
$('#wrong1, #wrong2, #wrong3, #wrong4').click(function () {
$(this).animate({
opacity: 0,
top: 100,
}, 500);
var divs = ['#wrong1, #wrong2, #wrong3, #wrong4'];
if ($(this).next(divs).length === 1)
$('#wrong-gameOne').eq(0).hide();
else
$('#correctOne').eq(0).show();
});