Add a eventListener to element .click()


Description: Add a "click" eventListener to an element.


<!doctype html>
    <html lang="en">
      <meta charset="utf-8">
      <title>click demo</title>
      <script src=""></script>
      <div class="content-container"><span class="clickMe">Click me</span></div>
      <script type="text/javascript">
               alert("SPAN was clicked.");


Click me
  • Usage

    • How to use:

      Add eventListener to an element. Allows for arguments to be passed to parameter function as a javascript object.

    • USAGE:

      bitsyCode("element").click(function, {});
    • Example: without arguments

      function myFunction(){
          //Add your code here
    • Example: with arguments

      bitsyCode("element").click(myFunction, { name: "BitsyCode" });
      function myFunction(args){
          alert(; //BitsyCode
  • Options

    • What options are there:

      This method takes 2 parameters, a function parameter to be called after element is clicked on and a
      arguments parameter.

      These arguments will be sent to the function parameter as an object once the element has been clicked.

  • Returns

    • Returns: No return type

      Function specified will be fired once element is clicked on.