Learn free online HTML5, javascript, and jquery Tutorials by Examples

Wednesday, 18 June 2014

password protected url in javascript

---------------------------------------------------
<script>
 function password(){
            ctp = prompt('plz enter the password');
            if(ctp=='satish'){
                window.location.href = "http://www.google.com";
                }
                else{
                        alert('plz try again');
                    }
        }
</script>

<a href="javascript:password();"><img src="images/clock.gif" alt="clock" width="156" height="156" /></a>


---------------------------------------------------

No comments:

Post a Comment