2 Replies Latest reply on Jan 12, 2019 3:37 AM by Jhon Carlo

    Set "onClick" like a variable

    Jhon Carlo Level 1

      I need to set "onClick" like a variable, something like this:

       

      <script>

      var = MyVar;

      MyVar = x;

       

      function MyFunction + MyVar (){

      MyCode;

      }

      </script>

       

      <button type="button"  onClick="MyFunction + MyVar()"> </button>

       

      Is there a way to set this?

       

      Thanks;