I have a function defined under script tag of index.html
function showAlert(){ alert("Hello");
How can I call this function on certain events?
Develop games in your browser. Powerful, performant & highly capable.
I wouldn't add your own script tag like that, as it will only make things harder. Writing all your script code in Construct will make it easier.
This and much more is covered in the Learn JavaScript in Construct tutorial series.