0
How to call function in web
HTML <div id="box" onclick=a()></div> JS window.onload = function() { function a(){ } } It make Error
1 Answer
0
SorryPark
If you are calling function from html elements then no need to write inside window.onload because function will call when you click.
also function should be inside single quotes or double quotes in html elements.
there should be onclick = 'a()'