Button at runtime, click event not triggered

What could be the reasons why an onclick event isn't triggered?
I have two buttons. One was created at design time and the other at runtime.
In the browser (debug), I only see an event for the first one.

The code is very simple

constructor TMyListItem.Create( AHTMLIndex: Integer);
begin
  inherited Create;
  FHTMLIndex := AHTMLIndex;
  FButtonDel := TWebButton.Create( 'MyElementID' + FHTMLIndex.ToString);
  FButtonDel.ElementClassName := '';
  FButtonDel.OnClick := ButtonDelOnClick;
end;
procedure TMyListItem.ButtonDelOnClick( Sender: TObject);
begin
  console.log( Sender);
end;

I don't have a parent. But even with the form as the parent, it didn't work.

FButtonDel.Parent := AOwner; // AOwner = TheForm

Is it perhaps a timing problem?
Is there anything else that needs to be done when elements (with events) are created at runtime?

Is there a HTML element with ID = "MyElementIDx" in the HTML associated with the form?
As this is what your constructor call expects.
If you do not have it, create it with:

Button := TWebButton.Create(AOwner);
Button.Parent := ButtonParent;