title: Input Box Calculator does not change result value
body: <p>I need to make a Calculator with Input boxes.</p>
  
  <p>This is my code and for some reason it doesnt change the result box value!</p>
  
  <p>As you can see I tried both <code>.val("result")</code> and <code>.attr("value","result")</code>
  Both don't work.</p>
  
  <p>Some help would be really nice!</p>
  
  <pre><code>&lt;html&gt;
    &lt;head&gt;
      &lt;meta charset="utf-8" /&gt;
      &lt;title&gt;Praktikum Webanwendungen&lt;/title&gt;
      &lt;style&gt;
        input,
        button {
          margin: 10px;
        }
      &lt;/style&gt;
      &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"&gt;
          $(document).ready(function(){
              $("#b1").click(function(){
                  Add();
              });
              $("#b2").click(function(){
                  Substract();
              });
              $("#b3").click(function(){
                  Multiply();
              });
              $("#b4").click(function(){
                  Divide();
              });
          });
          function Add(){    
           var no1=parseInt($("#number1").val());    
           var no2=parseInt($("#number2").val());    
           var result =no1+no2;    
            $("#ergebnis").attr("value","result")
          }    
          function Substract(){    
           var no1=parseInt($("#number1").val());    
           var no2=parseInt($("#number2").val());    
           var result =no1-no2;    
            $("#ergebnis").val(result)    
          }    
          function Multiply(){    
           var no1=parseInt($("#number1").val());    
           var no2=parseInt($("#number2").val());    
           var result =no1*no2;    
            $("#ergebnis").val("result")    
          }    
          function Divide(){    
           var no1=parseInt($("#number1").val());    
           var no2=parseInt($("#number2").val());    
           var result =no1/no2;    
            $("#ergebnis").val("result") 
          }
      &lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
  
      &lt;h1&gt;Taschenrechner&lt;/h1&gt;
      &lt;label for="num1"&gt;Zahl1: &lt;/label&gt;
      &lt;input id="number1" name="num1" type="number" /&gt;
  
      &lt;label for="num2"&gt;Zahl2: &lt;/label&gt;
      &lt;input id="number2" name="num2" type="number" /&gt;
  
      &lt;div&gt;
        &lt;button id="b1"&gt;+&lt;/button&gt;
        &lt;button id="b2"&gt;-&lt;/button&gt;
        &lt;button id="b3"&gt;x&lt;/button&gt;
        &lt;button id="b4"&gt;/&lt;/button&gt;
      &lt;/div&gt;
  
      &lt;label for="res"&gt;Ergebnis: &lt;/label&gt;
      &lt;input id="ergebnis" name="res" type="number" value = "" &gt;
    &lt;/body&gt;
  &lt;/html&gt;
  
  </code></pre>