1. Home
  2. Javascript
  3. On click

Runs a function when an object is clicked.

#javascript#event
object.onclick = function(){
    console.log(this);
};
copy
Full Javascript cheatsheet