Computer Science, asked by adityamankodi, 6 months ago

how to make a 2 number addition calculator in JavaScript using prompt boxes (please give code) and Its always adding the numbers like concatenating strings

Answers

Answered by keyboardavro
1

Answer:

Explanation:

<p>

 Click the button to calculate x.

 <button onclick="myFunction()">Try it</button>

</p>

<p>

 Enter first number:

 <input type="text" id="txt1" name="text1" value="1">

 Enter second number:

 <input type="text" id="txt2" name="text2" value="2">

</p>

<p id="demo"></p>

Similar questions