Html buttons in web assembly export

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By dsina
:warning: Old Version Published before Godot 3 was released.

I want to call a godot script function from an html button. It should be possible by using JavaScript global variables and constant polling(eg. in _process) but polling seems like a bad solution to me.
Is there some way already provided by Godot or atleast a way to make this closer to the observer pattern?