function in JavaScript
<p>I'm learning basics of JS and I wrote this script but it doesn't work as I aspected. It should add or subtract 10 value inside  tag and inside  tag value atribute depending on button click.</p>

<pre><code>&lt;!DOCTYPE HTML&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Meter&lt;/title&gt;
&lt;script type="text/javascript"&gt;
function f(a)
{
    document.getElementById("prog").value = document.getElementById("prog").value + a;
    var t = parseInt(document.getElementById("prog"),10);
    document.getElementById("prog") = t + a;
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;form title="Meter"&gt;
&lt;button type="button" onClick="f(-10);" &gt;Subtract&lt;/button&gt;
&lt;button type="button" onClick="f(10);" &gt;Add&lt;/button&gt;
&lt;meter  min="0" max="100" value="50" id="prog"&gt;50&lt;/meter&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
