Thursday, May 29, 2014

JAVASCRIPT BASIC EXAMPLES FOR BEGINNERS(Performing Add, Sub, Multiply,Divide.)

Performing Add, Sub, Multiply,Divide.

<HEAD><CENTER> </center></HEAD>
    <SCRIPT LANGUAGE="JAVASCRIPT">
      function fadd_click()
      {
accept();
document.f1.c.value=eval(x)+eval(y);
      }
      function fdiff_click()
      {
accept();
document.f1.c.value=eval(x)-eval(y);
      }
      function fmult_click()
      {
accept();
document.f1.c.value=eval(x)*eval(y);
      }      
      function fQuo()
      {
accept();
document.f1.c.value=eval(x)/eval(y);
      }
function accept()
      {
x=window.prompt("enter the value");
y=window.prompt("enter the value");
     }   
   </SCRIPT>
   <BODY>
   <FORM NAME=f1>
    <CENTER>
        <INPUT TYPE=BUTTON NAME=B1 VALUE="  +  " onClick="fadd_click()">&nbsp&nbsp&nbsp
      <INPUT TYPE=BUTTON NAME=B4 VALUE="  -  " onClick="fdiff_click()">&nbsp&nbsp&nbsp
      <INPUT TYPE=BUTTON NAME=B2 VALUE="  *  " onClick="fmult_click()">&nbsp&nbsp&nbsp
      <INPUT TYPE=BUTTON NAME=B3 VALUE="/" onClick="fQuo()">&nbsp&nbsp&nbsp
      <INPUT TYPE = TEXT NAME="c">&nbsp&nbsp&nbsp
   </center>
  </FORM>
  </BODY>
</HTML>





No comments:

Post a Comment

Thank you for visiting my blog

Kubernetes

Prerequisites We assume anyone who wants to understand Kubernetes should have an understating of how the Docker works, how the Docker images...