Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 2
Message 1 of 2

JS Time tracking system for sports

Hi world,

 

I'm in trouble. I'm developing a JS timetracking system for my running club, but I'm stuck at the JS timestamp function using appendChild. If you know something about these functions, then I'd love some suggestions - see my repository here.

 

Ideally the run-leader will input runners' numbers when they pass the finish line. When hitting enter the system will then list the number followed by the time. Meanwhile the time doesn't show well and I'm obviously not a master of JS :(

1 Reply
Copilot Lvl 2
Message 2 of 2

Re: JS Time tracking system for sports

Hi InnoViking,

 

If I understand your question correctly, you want to show the time displayed in the div txtDIV when hitting enter.

Currently it shows as undefined because you try to read the value of the div with the .value. If you use .innerHTML instead of .value on line 157, it will return the time displayed in the div.

 

var timeStamp = document.getElementById("txtDIV").innerHTML;