Advertisement
Guest User

Untitled

a guest
Jan 29th, 2015
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.46 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>project4</title>
  6. <script type="text/javascript" src="jquery-2.1.3.min.js"></script>
  7. <style>
  8. .div-parent {margin: auto; margin-top: 1%}
  9. .div-1{width: 48%;height: 300px;margin-top: 1%; margin-left: 1%; float: left; border: 1px solid transparent}
  10. .div-2{width: 48%; height:300px; margin-top: 1%; margin-left: 1%; float: left; border: 1px solid transparent}
  11. .div-3{width: 80%; height:200px; margin-top: 1%;border: 1px solid transparent;float: left;margin-left: 10%}
  12. #div-input{margin-top:20%; float: left; margin-left: 12%;width: 80%}
  13. #div-button{margin-top: 21%; float: left;margin-left: 10%;width: 12%}
  14. .input{
  15. width: 100%;height: 40px;
  16. border-radius: 5px;border: 1px solid #c2c2c2;
  17. font-size: 18px; padding-left: 12px;
  18. }
  19. .button{
  20. width: 100%;height:25px;
  21. border-radius: 5px; border: 1px solid #c2c2c2;
  22. background-color:lightslategrey; color: lightsteelblue;
  23. font-size: 14px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  24. cursor: pointer
  25. }
  26. #text{text-align: center;padding-top: 6%}
  27. </style>
  28. <script>
  29. var a, b, c, d, e;
  30. $(document).ready( function(){
  31. a=$('.input');
  32. b=$('.button');
  33. c=$('#form');
  34. d= a.val();
  35. e=$('#text');
  36. b.click(function(){
  37. if (d<0){d=d*(-1)}
  38. if(d<10){
  39. if(d==2||d==3||d==5||d==7){e.text('this is a prime number.');
  40. }
  41. else {e.text('this is not a prime number.');
  42. }
  43. }
  44. else{e.text('the number is too big.');
  45. }
  46. });
  47.  
  48. });
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55. </script>
  56.  
  57.  
  58. </head>
  59. <body>
  60. <div class="div-parent" >
  61. <div class="div-1" >
  62. <div id="div-input">
  63. <form id="form"> <input class="input" type="number" name="text" placeholder="input a number"
  64. onfocus="this.placeholder='' " onblur="this.placeholder='input a number' "></form>
  65. </div>
  66. </div>
  67. <div class="div-2" >
  68. <div id="div-button"> <button class="button" > Submit </button>
  69. </div>
  70. </div>
  71. <div class="div-3"> <h3 id="text"> hello! how was life ? are you well ? </h3>
  72. </div>
  73. </div>
  74. </body>
  75. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement