title: jquery alert box simple calculation
body: <p>I want to make simple calculation using js and jQuery.  Regarding the values in fields, alertbox should display calculation. Here is my code:</p>
  <pre><code>&lt;!DOCTYPE html&gt; 
  &lt;html&gt; 
      &lt;head&gt;
          &lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js&quot;&gt;&lt;/script&gt;
      &lt;/head &gt;
      &lt;body&gt;
  
          &lt;p id=&quot;demo&quot;&gt;&lt;/p&gt;
  
          &lt;script&gt;
              $(document).ready(function(){
                  $(&quot;#btn1&quot;).click(function(){
                      alert(&quot;Solution: &quot; + $(&quot;#demo&quot;).val());
                  });
              });
              
              function myFunction(a, b) {
                  var a;
                  var b;
                  return a * b;
              }
  
              document.getElementById(&quot;demo&quot;).innerHTML = myFunction(a, b);
          &lt;/script&gt;
  
          &lt;input id=&quot;a&quot; type=&quot;text&quot; value=&quot;10&quot; /&gt;
          &lt;input id=&quot;b&quot; type=&quot;text&quot; value=&quot;5&quot; /&gt;
          &lt;button id=&quot;btn1&quot;&gt;Result&lt;/button&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>