Advertisement
Guest User

Untitled

a guest
Jan 10th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.43 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width">
  6. <title>Mile High Login</title>
  7. <style id="jsbin-css">
  8. input {
  9. height: 42px;
  10. padding: 5px;
  11. font-size: 28px;
  12. }
  13.  
  14.  
  15. input:nth-child(1) {
  16. width: 150px;
  17. }
  18.  
  19.  
  20. input:nth-child(3) {
  21. width: 200px;
  22. margin-top: 10px;
  23. }
  24.  
  25. button {
  26. padding: 5px;
  27. height: 55px;
  28. vertical-align: top;
  29. background-color: lightblue;
  30. width: 125px;
  31. color: red;
  32. font-size: 30px;
  33. border: solid 1px black;
  34. }
  35. </style>
  36. </head>
  37. <body>
  38.  
  39.  
  40. <!-- FORM -->
  41. <div>
  42. <h1> Mile High Club</h1>
  43. <!-- ASSIGN ATTRIBUTE TYPE = NUMBER -->
  44. <input placeholder="Year Born" />
  45. <!--
  46. <select></select>
  47. -->
  48. <br /><br />
  49.  
  50. <!-- ASSIGN ATTRIBUTE TYPE = TEXT -->
  51. <input placeholder="Username" />
  52. <br /><br />
  53.  
  54. <!-- ASSIGN ATTRIBUTE TYPE = PASSWORD -->
  55. <input placeholder="Password"/>
  56.  
  57. <!-- -->
  58. <button class="tap">Login</button>
  59. </div>
  60.  
  61.  
  62. <!-- DISPLAY MESSAGE HERE -->
  63. <div></div>
  64. <script id="jsbin-javascript">
  65. var user = "AlIcE", pass = "WoNdErLaNd", age = 36;
  66.  
  67.  
  68.  
  69. // PART I
  70.  
  71. // Create a click handler for your button
  72. // Within it
  73. // Get the
  74. // 1. username textbox value and save it
  75. // 2. password textbox value and save it
  76. // 3. year born textbox value parse to Number and save it
  77. // At the end of your *scope*
  78. // Type in this line below; fill in variable with the previous 2 lines
  79. // validateLogin( variable #1 , variable #2, variable #3 );
  80. var input1;
  81. var input2;
  82. var input3;
  83. $(".tap").click(function(){
  84. input1= $(".Year Born");
  85. input2= $(".Username");
  86. input3= $(".Password");
  87. });
  88.  
  89.  
  90.  
  91.  
  92.  
  93. // PART II
  94. // Type in the line below
  95. // function validateLogin( variable #1 , variable #2, variable #3 ) { }
  96.  
  97. // Within it's scope
  98. // 1. check to see if the textbox username equals user variable
  99. // 2. repeat step 1 except compare textbox password to pass
  100. // 3. check if the age is older than the age variable then save one of the messages w/ a variable
  101. // "You are a young adult"
  102. // else
  103. // "Please wait ## years before you can join!"
  104.  
  105.  
  106. // if valid entry; hide the form and display your entry message
  107. // else display the wait message but do not hide the form
  108. // style the message accodingly. *Use your discretion*
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119. // CHALLENGE
  120. // populateSelectMenu();
  121.  
  122. function generateYears(){
  123. var begin = 1960, end = 2017, htmlStr = "";
  124.  
  125. for(begin; begin <= end; begin++) {
  126. htmlStr += "<option>" + begin + "</option>";
  127. }
  128.  
  129. return htmlStr;
  130. }
  131.  
  132.  
  133. function populateSelectMenu() {
  134.  
  135. }
  136. </script>
  137.  
  138.  
  139. <script id="jsbin-source-css" type="text/css">input {
  140. height: 42px;
  141. padding: 5px;
  142. font-size: 28px;
  143. }
  144.  
  145.  
  146. input:nth-child(1) {
  147. width: 150px;
  148. }
  149.  
  150.  
  151. input:nth-child(3) {
  152. width: 200px;
  153. margin-top: 10px;
  154. }
  155.  
  156. button {
  157. padding: 5px;
  158. height: 55px;
  159. vertical-align: top;
  160. background-color: lightblue;
  161. width: 125px;
  162. color: red;
  163. font-size: 30px;
  164. border: solid 1px black;
  165. }</script>
  166.  
  167. <script id="jsbin-source-javascript" type="text/javascript">var user = "AlIcE", pass = "WoNdErLaNd", age = 36;
  168.  
  169.  
  170.  
  171. // PART I
  172.  
  173. // Create a click handler for your button
  174. // Within it
  175. // Get the
  176. // 1. username textbox value and save it
  177. // 2. password textbox value and save it
  178. // 3. year born textbox value parse to Number and save it
  179. // At the end of your *scope*
  180. // Type in this line below; fill in variable with the previous 2 lines
  181. // validateLogin( variable #1 , variable #2, variable #3 );
  182. var input1;
  183. var input2;
  184. var input3;
  185. $(".tap").click(function(){
  186. input1= $(".Year Born");
  187. input2= $(".Username");
  188. input3= $(".Password");
  189. });
  190.  
  191.  
  192.  
  193.  
  194.  
  195. // PART II
  196. // Type in the line below
  197. // function validateLogin( variable #1 , variable #2, variable #3 ) { }
  198.  
  199. // Within it's scope
  200. // 1. check to see if the textbox username equals user variable
  201. // 2. repeat step 1 except compare textbox password to pass
  202. // 3. check if the age is older than the age variable then save one of the messages w/ a variable
  203. // "You are a young adult"
  204. // else
  205. // "Please wait ## years before you can join!"
  206.  
  207.  
  208. // if valid entry; hide the form and display your entry message
  209. // else display the wait message but do not hide the form
  210. // style the message accodingly. *Use your discretion*
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221. // CHALLENGE
  222. // populateSelectMenu();
  223.  
  224. function generateYears(){
  225. var begin = 1960, end = 2017, htmlStr = "";
  226.  
  227. for(begin; begin <= end; begin++) {
  228. htmlStr += "<option>" + begin + "</option>";
  229. }
  230.  
  231. return htmlStr;
  232. }
  233.  
  234.  
  235. function populateSelectMenu() {
  236.  
  237. }</script></body>
  238. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement