You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

76 lines
1.3 KiB
JavaScript

4 years ago
4 years ago
4 years ago
$(document).ready(function() {
var counter = 0;
$("#forniture1").click(function(){
counter ++;
$('#result').html(counter);
$("#forniture1").hide();
$("#child1").show();
4 years ago
winning();
4 years ago
if (counter===1) {
console.log("first click");
localStorage.child=1;
localStorage.childImage= $("#child1").attr("src");
}
4 years ago
});
4 years ago
4 years ago
$("#forniture2").click(function(){
counter ++;
$('#result').html(counter);
$("#forniture2").hide();
$("#child2").show();
4 years ago
winning();
4 years ago
});
$("#forniture3").click(function(){
counter ++;
$('#result').html(counter);
$("#forniture3").hide();
$("#child3").show();
4 years ago
winning();
4 years ago
});
$("#forniture4").click(function(){
counter ++;
$('#result').html(counter);
$("#forniture4").hide();
$("#child4").show();
4 years ago
winning();
4 years ago
});
$("#forniture5").click(function(){
counter ++;
$('#result').html(counter);
$("#forniture5").hide();
$("#child5").show();
4 years ago
winning();
4 years ago
});
$("#forniture6").click(function(){
counter ++;
$('#result').html(counter);
$("#forniture6").hide();
$("#child6").show();
4 years ago
winning();
4 years ago
});
4 years ago
function winning() {
if (counter === 6) {
4 years ago
$('#win').html("you are a savior <3 <3");
window.open("https://www.bbc.com/news/world-53416247");
4 years ago
} };
4 years ago
});;
4 years ago