HTML: live calculation via javascript (jquery) including variables with initialization
<p>i am very new to JS and strugle with the following problem:</p>

<p>I want wo convert the value in the numberbox in the answer beside by any change of the value. Including the variables NP0, NP1 and DP0 from the HTML element.</p>

<p>-------------------------UPDATE 1--------------------------</p>

<p>To use html variables in javascript we can do this via data-* attributes. Thanks to Luca.</p>

<p>But how can I intitiate a calculation, when the page is loading for the first time?</p>

<p>And how can the calculation be executed on any change of the value?</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>    $(".slide").on('change mousemove', function() { 
      $(this).next(".text").text(this.value)
    });
    $(".calc").on('change paste keyup', function() {  
      $(this).next(".text").text((128+(this.value*0.0625))/1)
    });</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="http://code.jquery.com/jquery-2.2.2.min.js"&gt;&lt;/script&gt;

&lt;input name="period" class="slide" value="0.25" min="0" max="0.5" step="0.01" style="width: 15em;" type="range"&gt;&lt;label class="text"&gt;0.25&lt;/label&gt;

&lt;br&gt;
&lt;br&gt;
&lt;input name="period" class="calc" value="0" min="0" max="4096" type="number" NP0="128" NP1="0.00625" DP0="1"&gt;= &lt;label class="text"&gt;&lt;/label&gt; km/h</code></pre>
</div>
</div>
</p>