Let’s ask the users for their name and age.
The first question should be What is your name?
.
The second question should be How old are you?
.
If at least one field is empty, or age is not a number,
add a p
element to the body
with the text: Invalid data
If all is well, show the message: Hi, {name}! I am {age} years old too.
.
{name} is a user-entered name, {age} is a user-entered age.
Use the internal script.
This task is part of the Full-Stack JavaScript Course
If you have any issues with it, you can ask for community help below the post
Feel free to help others if you’ve already solved the task
index.html
<!DOCTYPE html>
<html>
<head>
<title>Hi</title>
</head>
<body></body>
</html>