You can get multiple child of a parent element by using JavaScript Array forEach() or you can use for loops. Also we can sum of…