Question: How can I solve this HTML and JavaScript problem? I need to create a page where the HTML there is one question How many members

How can I solve this HTML and JavaScript problem?

I need to create a page where the HTML there is one question "How many members are in your family?" and there is a button, when I click the button a prompt needs to appear and asks "name of a member of the family" and when you enter it needs to appear another prompt asking for the age, finally it will print the age and the name of the person you wrote in a numbered list, the problem is that I have to do it in two different functions, one to print what you wrote in the prompt and the next function needs to work only for the functions. I have the prompts working good but I don't know what to do with the other one, Can someone help? please

Here's what I have done

The HTML:

Family

Family

How many members are on your family?

Here's the JavaScript

"use strict"

function newPersonAndAge(personId, newTextElement){

}

function addNewPerson(){

let item = prompt ("Enter the name of a member of your family");

let price = prompt ("Enter their age");

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!