//This is a Js Calculator Code  
<!Doctype html>
<html>
<head>
  <title>Calculator</title>
  <script>
  function show(n) {
    document.calform.screen.value = document.calform.screen.value + n;
  }
  function operation(op) {
    document.calform.screen.value = document.calform.screen.value + op;
  }
  function equals() {
    document.calform.screen.value=eval(document.calform.screen.value);
  }
  </script>
</head>
<body>
  <center>
    <form name="calform" style="width:200px;" method="post">
      <fieldset border="1px">
        <legend> Calculator</legend>
        <input type="text" name="screen" /><br/><br/>
        <button onclick="show('7')">7</button>
        <button onclick="show('7')">8</button>
        <button onclick="show('7')">9</button>
        <button onclick="operation('+')">+</button><br/>
        <button onclick="show('7')">4</button>
        <button onclick="show('7')">5</button>
        <button onclick="show('7')">6</button>
        <button onclick="operation('-')">-</button><br/>
        <button onclick="show('7')">3</button>
        <button onclick="show('7')">2</button>
        <button onclick="show('7')">1</button>
        <button onclick="operation('*')">*</button><br/>
        <button onclick="operation('/')">/</button>
        <button onclick="operation('%')">%</button>
        <button onclick="">=</button>
        <button onclick="">C</button>
      </fieldset>
    </form>
  </center>
</body>
</html>    
The problem with this code is that it insert the value in the form's textfield on onclick event of a button but the value doesn't hold in the textfield after click event........ Kindly leave your suggestions to resolve this issue..
 
     
    