+ 3

How to make and check events in javascript on sololearn? Please help!

14th May 2017, 3:54 PM
Shedrick Williams
Shedrick Williams - avatar
3 Antworten
+ 8
here's an example of a button click event thru javascript HTML: <button id="myBtn">Click Me!<button> JavaScript: var myBtn = document.getElementById("myBtn"); myBtn.onclick = function(){ // do something }
14th May 2017, 4:03 PM
Burey
Burey - avatar
+ 6
what kind of events? touch? mouse click? phone tilt? something else?
14th May 2017, 3:57 PM
Burey
Burey - avatar
+ 2
like mousepressed or keypressed
14th May 2017, 3:58 PM
Shedrick Williams
Shedrick Williams - avatar