hi ya
i need help with creating a password on my website
i want to create an buttons which are of images
i want about 8 button images on the page and for a user to enter a site, they need to click on a sequence of images before they can enter. so for example they would need to click 4 different images before they can enter.
i would be very grateful if someone could help me
here is what i tries with just 4 images but cannot get it to work
<html>
<head>
</head>
<script type = “text/javaScript”>
function doSomething(k)
var n = 0;
var counter = 0;
counter = counter = 1;
{
if(n==0 && k==3){
n=1}
else if (n==1 && k==1){
n=2}
else{
n=0
}
window.alert(“k= ” + k+ “n = ” + n)
if (n==2){
window.open(‘
}
else if (counter ==2) {
window.alert (‘sorry wrong password’)
counter=0
n=0
}
}
</script>
<body>
<button id = foo1 onClick = “doSomething(1)”>
<img src = “1.jpg” width = 50 height = 50>
</button>
<button id = foo2 onClick = “doSomething(2)”>
<img src = “2.jpg” width = 50 height = 50>
</button>
<button id = foo3 onClick = “doSomething(3)”>
<img src = “3.jpg” width = 50 height = 50>
</button>
<button id = foo4 onClick = “doSomething(4)”>
<img src = “4.jpg” width = 50 height = 50>
</button>
</body>
</html>