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.
78 lines
1.3 KiB
JavaScript
78 lines
1.3 KiB
JavaScript
|
|
$(document).ready(function() {
|
|
|
|
var counter = 0;
|
|
|
|
|
|
$("#forniture1").click(function(){
|
|
counter ++;
|
|
$('#result').html(counter);
|
|
$("#forniture1").hide();
|
|
$("#child1").show();
|
|
winning();
|
|
});
|
|
|
|
$("#forniture2").click(function(){
|
|
counter ++;
|
|
$('#result').html(counter);
|
|
$("#forniture2").hide();
|
|
$("#child2").show();
|
|
winning();
|
|
});
|
|
|
|
$("#forniture3").click(function(){
|
|
counter ++;
|
|
$('#result').html(counter);
|
|
$("#forniture3").hide();
|
|
$("#child3").show();
|
|
winning();
|
|
});
|
|
|
|
$("#forniture4").click(function(){
|
|
counter ++;
|
|
$('#result').html(counter);
|
|
$("#forniture4").hide();
|
|
$("#child4").show();
|
|
winning();
|
|
});
|
|
|
|
$("#forniture5").click(function(){
|
|
counter ++;
|
|
$('#result').html(counter);
|
|
$("#forniture5").hide();
|
|
$("#child5").show();
|
|
winning();
|
|
});
|
|
|
|
$("#forniture6").click(function(){
|
|
counter ++;
|
|
$('#result').html(counter);
|
|
$("#forniture6").hide();
|
|
$("#child6").show();
|
|
winning();
|
|
});
|
|
|
|
function winning() {
|
|
if (counter === 6) {
|
|
$('#win').html("you won!");
|
|
//alert ("you won");
|
|
|
|
} };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});;
|
|
|
|
/*(function() {
|
|
if (counter === 6) {
|
|
//$('#winmessage').html("you won!");
|
|
alert ("you won");
|
|
|
|
} });
|
|
|
|
if (counter == 1) {
|
|
console.log ("you won");
|
|
}*/ |