in a recent post Load javascript after 2 clicks on website I asked about a javascript issue.
$(function(){
var count = 1
$(document).click(function(){
if(count<=2){
count+=1;
}
else{
alert("already clicked two times");
}
});
})
Problem is now that I want to have this javascript it inside script tags in my <head>
but then this script wont work, can someone help me through how they would write their script? Thanks!!
Update:
<head>
<script>
$(function(){
var count = 1
$(document).click(function(){
if(count<=2){
count+=1;
}
else{
alert("already clicked two times");
}
});
})
</script>
</head>