Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>project4</title>
- <script type="text/javascript" src="jquery-2.1.3.min.js"></script>
- <style>
- .div-parent {margin: auto; margin-top: 1%}
- .div-1{width: 48%;height: 300px;margin-top: 1%; margin-left: 1%; float: left; border: 1px solid transparent}
- .div-2{width: 48%; height:300px; margin-top: 1%; margin-left: 1%; float: left; border: 1px solid transparent}
- .div-3{width: 80%; height:200px; margin-top: 1%;border: 1px solid transparent;float: left;margin-left: 10%}
- #div-input{margin-top:20%; float: left; margin-left: 12%;width: 80%}
- #div-button{margin-top: 21%; float: left;margin-left: 10%;width: 12%}
- .input{
- width: 100%;height: 40px;
- border-radius: 5px;border: 1px solid #c2c2c2;
- font-size: 18px; padding-left: 12px;
- }
- .button{
- width: 100%;height:25px;
- border-radius: 5px; border: 1px solid #c2c2c2;
- background-color:lightslategrey; color: lightsteelblue;
- font-size: 14px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
- cursor: pointer
- }
- #text{text-align: center;padding-top: 6%}
- </style>
- <script>
- var a, b, c, d, e;
- $(document).ready( function(){
- a=$('.input');
- b=$('.button');
- c=$('#form');
- d= a.val();
- e=$('#text');
- b.click(function(){
- if (d<0){d=d*(-1)}
- if(d<10){
- if(d==2||d==3||d==5||d==7){e.text('this is a prime number.');
- }
- else {e.text('this is not a prime number.');
- }
- }
- else{e.text('the number is too big.');
- }
- });
- });
- </script>
- </head>
- <body>
- <div class="div-parent" >
- <div class="div-1" >
- <div id="div-input">
- <form id="form"> <input class="input" type="number" name="text" placeholder="input a number"
- onfocus="this.placeholder='' " onblur="this.placeholder='input a number' "></form>
- </div>
- </div>
- <div class="div-2" >
- <div id="div-button"> <button class="button" > Submit </button>
- </div>
- </div>
- <div class="div-3"> <h3 id="text"> hello! how was life ? are you well ? </h3>
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement