Advertisement
Guest User

Untitled

a guest
Oct 25th, 2016
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. <html>
  2. <head>
  3. <meta charset="utf-8">
  4. <link rel="stylesheet" type="text/css" href="szablon.css" />
  5. <title>yup</title>
  6. </head>
  7. <body>
  8. <div id="box">
  9. <div id="gora">
  10. <p align="center"><font size="15"></font></p>
  11. </div>
  12. <div id="srodek">
  13.  
  14. <script type="text/javascript">
  15.  
  16.  
  17. function sprawdz(f) {
  18. var haslo = f.pole.value;
  19. var dh = haslo.length;
  20. document.getElementById("dlugosc").innerHTML = "a) dlugosc hasla to: " + haslo.length;
  21. document.getElementById("pierwsza").innerHTML = "b) pierwsza litera hasla to: " + haslo.charAt(0);
  22. document.getElementById("trzecia").innerHTML = " trzecia litera hasla to: " + haslo[2];
  23. document.getElementById("ostatnia").innerHTML = "c) ostatnia litera hasla to: " + haslo[haslo.length-1];
  24. for(i=0; i<=dh; i++){
  25. if (haslo[i]==" ") {
  26. document.getElementById("spacja").innerHTML = "e) masz spacje";
  27. }
  28. }
  29.  
  30. for(i=0; i<=dh; i++){
  31. if(haslo[i] *1){
  32. document.getElementById("cyfry").innerHTML = "f) masz cyfry";
  33. }
  34. }
  35.  
  36.  
  37.  
  38.  
  39. }
  40. </script>
  41.  
  42.  
  43. <form action="">
  44. Podaj haslo: <input type="text" name="pole">
  45. <input type="button" value="sprawdz" onClick="sprawdz(this.form)"><br></br>
  46. </form>
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54. <p id="dlugosc"></p>
  55. <p id="pierwsza"></p>
  56. <p id="trzecia"></p>
  57. <p id="ostatnia"></p>
  58. <p id="spacja"></p>
  59. <p id="cyfry"></p>
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. </div>
  71. <div id="lewy">
  72.  
  73.  
  74.  
  75.  
  76. </div>
  77. </div>
  78. <div id="akt">
  79.  
  80. </div>
  81. </body>
  82. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement