title: I want to display the value of a variable using innerHTML but my code isnt working
body: <p>I am new to javascript. I tried displaying the value of a variable on clicking a button with the following code. But it isn't working. </p>
  
  <pre><code>var i = document.getElementById("inp").value;
  var m=i-1;
  var s=59;
  function func() 
  {
      document.getElementById("display").innerHTML = m +":"+s;
  }
  </code></pre>