Onclick event capture on form

Anonymous
Not applicable

Onclick event capture on form

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

MktoForms2.whenReady(function (form) {

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

           alert("hi");

 

        });

      });

1 REPLY 1
SanfordWhiteman
Level 10 - Community Moderator

Re: Onclick event  capture on form

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?