0
How to make this work
4 odpowiedzi
+ 2
mistakes :
use myButton.addEventListener('click', runFunction);
instead of
myButton.addEventListener('click', runFunction());
brackets are the problem
there is not need to give brackets runFunction()
2. if it shows runFunction is not defined try to write hole thing inside
window.onload()=>{
//Your code
}
3. if window.onload()=>{ } doesn't work try to use rupali solution
+ 1
Put your JS in script tag in Html section, it will work..
+ 1
HrCoder Thanks, you give me my mistake, now it's work when i click button
0
Thanks, it's work now