joelnazarene

javascript

Feb 26th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.88 KB | None | 0 0
  1. <html><head><title> some weird title </title></head>
  2. <body>
  3. <p id="1"></p>
  4. <script>
  5. var strings=window.prompt("enter a string");
  6. for(var i=0; i<strings.length;i++){
  7.    character = strings.charAt(i);
  8.    if (!isNaN(character * 1)){
  9.        alert('character is numric');
  10.    }else{
  11.        if (character == character.toUpperCase()) {
  12.            alert ('upper case true');
  13.        }
  14.        if (character == character.toLowerCase()){
  15.            alert ('lower case true');
  16.        }
  17.    }
  18. }
  19. </script>
  20.  
  21. </body>
  22. </html>
  23.  
  24.  
  25.  
  26.  
  27. <html><head><title> some weird title </title></head>
  28. <body>
  29. <p id="1"></p>
  30. <script>
  31. var numOfTrue;
  32. var Answers = [ "true", "false", "false", "true", "false" ];
  33.  
  34. var numOfTrue = 0;
  35. for(var i=0;i<Answers.length;i++){
  36.    if(Answers[i] === "true")
  37.       numOfTrue++;
  38. }
  39.  
  40. document.write(numOfTrue);
  41.  
  42.  
  43. </script>
  44.  
  45. </body>
  46. </html>
Add Comment
Please, Sign In to add comment