How do i get JavaScript to show number instead of strings : <p>So i'm quite new to javascript and im trying to make this thing where i enter 2 values and it will either plus, multiply, divide etc. from what i enter in the code. But somehow when i try to multiply 5*2 it will show 10 but when i try 5+2 it will show 52, how do i fix this? I tried parseInt() but it didnt work</p>

<p>[Output][1]</p>

<p>Code:</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>function myfunction() {
var x = document.getElementById("fname").value;
var y = document.getElementById("lname").value;
var z = x + y;

document.getElementById("output").innerHTML = z;</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;form&gt;
&lt;input type="Number" id="fname" value="" &gt;&lt;br&gt;&lt;br&gt;
&lt;input type="number" id="lname" value="" &gt;&lt;br&gt;&lt;br&gt;


&lt;/form&gt;

&lt;button type="button" onclick="myfunction()"&gt;submit&lt;/button&gt;

&lt;p id="output"&gt;&lt;/p&gt;</code></pre>
</div>
</div>
</p>
