0

How to use function in function?

Don't work my code with click event. For example, var image=document.getElementById(); var dop=math.random(); var number=1; function Start(){ number×=dop; function MoreCards(){ image.src='dolbaeb.png'; } }

11th Jan 2021, 4:01 PM
Almas
Almas - avatar
4 ответов
+ 4
To use function inside Another function you can call the function two inside function one like this example function function_one() { function_two(); console.log("The function called 'function_one' has been called."); } function function_two() { console.log("The function called 'function_two' has been called."); } function_one();
11th Jan 2021, 4:42 PM
Jamal Saied
Jamal Saied - avatar
0
It's called a nested/inner function and you call it inside the outer function, also using "×" for multiplication is incorrect use * 🙂
11th Jan 2021, 4:40 PM
D_Stark
D_Stark - avatar
0
How correct it?
11th Jan 2021, 4:42 PM
Almas
Almas - avatar
0
Thank u. I can try correct my code
11th Jan 2021, 4:45 PM
Almas
Almas - avatar