procedure TMyApplication.doRun;
begin
// Your code here
BindElements;
btnLogin.AddEventListener('click',@DoLoginCLick);
Terminate;
end;
procedure TMyApplication.BindElements;
begin
Writeln('BindElements');
edtEmail:=TJSHTMLInputElement(GetHTMLElement('edtEmail'));
edtPassword:=TJSHTMLInputElement(GetHTMLElement('edtPassword'));
btnLogin:=TJSHTMLButtonElement(GetHTMLElement('btnLogin'));
end;
procedure TMyApplication.doLoginClick(aEvent: TJSEvent);
begin
Writeln('doLoginClick');
// BindElements; // <- uncomment and all works!
writeln('edtEmail.Value = ', edtEmail.value); // <- this give the error
DoServerLogin(edtEmail.Value,edtPassword.Value);
end;