Onclick event capture on form | Community
Skip to main content
April 24, 2018
Question

Onclick event capture on form

  • April 24, 2018
  • 1 reply
  • 962 views

I would like to capture onclick event, I have below code, which is not working

MktoForms2.whenReady(function (form) {

         $('.test').click(function(){

           alert("hi");

 

        });

      });

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

SanfordWhiteman
Level 10
April 24, 2018

HTMLElement#click() is a method, not an event listener.

Please explain exactly what you're trying to do as there's no context here, not even a sample page. Think about it... how would we know if an element with class test exists in your document?