I need to make a domain with the following:
- Ask the user for his or her name.
- Prompt the user for a number between 1 and 100 both included.
- Prompt the user for a number between 10 and 20 both included. <
- Give an output with the following text:
"Dear name of user the first number you entered was first number the second was second number. If we multiply these two number we get
So far I've gotten this:
function myFunction() {
var person = prompt("Please enter your name", "enter name");
if (person != null) {
document.getElementById("demo").innerHTML =
"Hello " + person + "! How are you today?";
}
function addNumbers() {
var val1 = parseInt(document.getElementById("value1").value);
val val2 = parseInt(document.getElementByID("value").value);
var ansD = document.getElementByID("answer");
ansD.value = val1 + val2;
}
<p>Click the button to demonstrate the prompt box.</p>
<button onclick="myFunction()">Click me</button>
<p id="demo"></p>
IDis notIdand you are missing value, value1 and answeridandID.