Advertisement
Aniket_Goku

js6

Apr 22nd, 2021
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <html>
  2.     <head>
  3.         <title>js6</title>
  4.     </head>
  5.     <script>
  6.         function  f1()
  7.         {
  8.             var i,ch,n1,n2;
  9.              n1=parseInt(document.getElementById("c1").value);
  10.              n2=parseInt(document.getElementById("c2").value);
  11.            
  12.             if (isNaN(n1) || isNaN(n2) )
  13.             {
  14.                 if (isNaN(n1))
  15.                 {
  16.                     document.getElementById("c1").focus(); 
  17.                 }
  18.                 if (isNaN(n2))
  19.                 {
  20.                     document.getElementById("c2").focus(); 
  21.                 }
  22.                 ch="Check Data";   
  23.             }
  24.             else
  25.             {
  26.                 ch=parseInt(n1*n2);
  27.                
  28.             }
  29.             document.getElementById("c3").value=ch;
  30.         }
  31.     </script>
  32.     <style>
  33.         body
  34.         {
  35.             background-image:url("file:///D:/backgrounds/41.png");
  36.             background-color:skyblue;
  37.             background-attechment:fixed;
  38.             backdrop-filter:blur(7px);
  39.             height:100vh;
  40.             background-size:100% 100%;
  41.             margin:0;
  42.             padding:0;
  43.             background-repeat:no-repeat;
  44.            
  45.         }
  46.         .style1
  47.         {
  48.             background:yellow;
  49.             border-radius:20%;
  50.             font-size:20px;
  51.         }
  52.         .s2
  53.         {
  54.             border-radius:0%;
  55.             border-color:red;
  56.             background:black;
  57.             color:white;
  58.             font-size:17px;
  59.            
  60.         }
  61.        
  62.     </style>
  63.     <body   text="White">
  64.         <center>
  65.             <h1 > Multiply</h1>
  66.         </center>  
  67.         <table border="0" align="center" cellspacing="20" cellpadding="70" width="30%">
  68.             <form >
  69.                 <tr>
  70.                     <td>    <input type="textbox"class="s2" id="c1" onchange="f1()" placeholder="No1"></td>
  71.                     <td>    <input type="button"class="style1" value="X"></td>
  72.                     <td>    <input type="textbox"class="s2" id="c2" onchange="f1()" placeholder="No2" ></td>
  73.                     <td>    <input type="submit"  class="style1" value="=" ></td>
  74.                     <td>    <input type="textbox" class="s2" id="c3"  placeholder="Ans" ></td>
  75.                 </tr>
  76.                    
  77.             </form>
  78.         </table>
  79.     </body>
  80.  
  81. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement