Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>One-Time Password</title>
- <script type = "text/javascript">
- function generateOTP(limit){
- var symbols = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
- var OTP = '';
- for(var i = 0; i < limit; i++)
- OTP += symbols.charAt((Math.random()*1000)%symbols.length)
- return(OTP);
- }
- </script>
- </head>
- <body>
- <form name = "OTP">
- Size of OTP: <input type = "text" name = "textarea" value ="8" size = "1"/>
- <input type = "submit" value ="Generate OTP" onClick = "alert('OTP is '+generateOTP(OTP.textarea.value))" />
- </form>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement