How to call Delphi Procedure from JavaScript code in TMS WEB Core?

I want to call/execute a Delphi procedure via my JavaScript code, but I’m not sure how.

I have my procedure declared as a public procedure within my form’s class declaration like this:

TfrmMain = class(TWebForm)
  ...
private
  { Private declarations }
public
  { Public declarations }
  procedure MyDelphiProcedure(MyParam: UInt64);
end;

And then somewhere on my web page, I have an HTML Image with an onClick event attached to it. I’d like to call my Delphi function from that onClick event, but how? This HTML image is not linked to any Delphi component. It’s just a standalone HTML image that is dynamically created using JavaScript.

Just simply doing MyDelphiProcedure(1); fails. Doing this.MyDelphiProcedure(1); also fails.

How can I access my form and call the Delphi function from JavaScript?