Sorry about that. Yes, I see the issue now.
In your event listener (below), you call leadinScore function.
document.getElementById('total').addEventListener('click', leadingScore);
The first argument passed an event handler function is the event object. So, inside leadingScore, the parameter pointWar will be the event object and pointHor will be undefined. You need to get the applicable input values when the Total button is clicked. One suggestion is to use warriorsPoints and hornetsPoints functions to do that, but not by passing a value to them. Below is how I would write warriorPoints.
// warrior function
function warriorsPoints(){
// get the element value from the input text
var setinputwarriors = document.getElementById('pointswar').value;
//set the input value to the DOM UI
document.getElementById('war-points').textContent = setinputwarriors;
return setinputwarriors;
};
I will let you correct the hornetsPoints function.
Also, your leadingScore function does not need any parameters as you will not be using anything passed to it.
Next you have another issue in your if, else if, and else statements. You have to remember that input values are strings, so if Warriors input value is 12, then it really is “12”. This means your if statement is comparing “12” > “4” which is false. The easiest way to fix that is to use parseInt or Number function to convert the points within the warriorPoints and hornetsPoints functions.
Lastly, I notice you have an else statement, but if the else statement is executed, that would be there was a tie, so I am not sure why you would say “Hornets has a leading score of 0 points”. Instead, I would say there was a tie game, but that is just my opinion.