Good afternoon.
There are two simple functions.
<!DOCTYPE html>TestPoint No. 1: var a = 2;function Test(){switch(a){case 1:document.write(1);break;case 2:document.write(2);break;}};function Test1(){Test();document.getElementById('user_1').innerHTML = a;}setInterval(Test1, 1000);
When you call the function Test1 must run first the Test function, and then code Test1.
However, I get "Uncaught TypeError: Cannot set property 'innerHTML' of null at Test1".
What is my mistake?