Try writing some code:
  1. start a new html document
  2. Inside the body, put your name inside an H1 tag
  3. Add a script tag:
    <script>
    
    </script>
    
  4. Declare a variable named answer
  5. Use the prompt() function to get a value for answer
    answer=prompt("Enter a number", "0");
    
  6. alert the answer:
    alert (answer);
  7. Get a second number
  8. Write the second number to the screen using document.write
    value2=prompt("enter another number", "0");
    document.write (value2);
    
  9. alert the sum of the 2 numbers
    alert("the answer is" + answer+value2)
  10. What's wrong??
    You can't mix strings and numbers
  11. Try the following code to see what is happening
      alert (parseInt(answer)+parseInt(value2));
      alert ("answer:" + parseInt(answer)+parseInt(value2));
    
  12. Now, lets fix the code to work the way we want
      sum= parseInt(answer)+parseInt(value2);
      alert ("answer:" + sum);
    
Link to solution