Seeking assistance on showcasing the number of seconds that have elapsed using a setInterval function in JavaScript integrated within HTML. The code snippet below has been attempted, but it is only displaying 1 second and the test function appears to not be running more than once. Any guidance or suggestions would be greatly valued!
var n=1;
function test() {
document.write(n);
n=n+1;
}
setInterval(test(), 1000);