title: How to convert a string to a number in html? and how to pass a variable into scriptlet code?
body: <p>How can I convert a string into a number in HTML? I wanted to convert an input value into a number and pass it into the script code. Pressing the button should do this conversion and pass the variable. </p>
  
  <pre class="lang-html prettyprint-override"><code>Enter a number: &lt;input type="text" id="number" value=10&gt;
  &lt;input type="button" id="change-btn" value="Change" onclick="getInput(number.value)"&gt;
  
  &lt;script language="javascript" type="text/javascript"&gt;
      function getInput(x){
          var input = x;
          alert(input);
      }
  &lt;/script&gt;
  
  &lt;Table border=2&gt;
      &lt;% for(int i = 1; i &lt;= **X**; i++) { %&gt;
          &lt;tr&gt;
              &lt;td&gt;Number&lt;/td&gt;
              &lt;td&gt;&lt;%= i %&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;% } %&gt;
  &lt;/Table&gt;
  </code></pre>