[3 / 2 / ?]
Quoted By:
I imagined it so easy, but I'm stuck...
I have my html-page with a button which should be clicked and then Hello would pop up - thats the goal... Easy right?
I somehow fck it up, so as premise i want my script to be saved elsewhere (ez, <script> src=...</script>) but while testing i must have fcked up somewhere and i dont get it, JS:
document.getElementById("test").addEventListener('click',alert('hallo'));
so button id="test" (right now i try working with input.. didnt work (did <button> before) what a surprise..
i guess i did something wrong with getelement, i do get the pop up hello, but its right after loading, not after pushing the button..
I have my html-page with a button which should be clicked and then Hello would pop up - thats the goal... Easy right?
I somehow fck it up, so as premise i want my script to be saved elsewhere (ez, <script> src=...</script>) but while testing i must have fcked up somewhere and i dont get it, JS:
document.getElementById("test").addEventListener('click',alert('hallo'));
so button id="test" (right now i try working with input.. didnt work (did <button> before) what a surprise..
i guess i did something wrong with getelement, i do get the pop up hello, but its right after loading, not after pushing the button..