How to call a Javascript function from a markdown page

I am using the admin panel to update my About page.

What I want to do is adding a html textbox and calling a subscribe() function when user hits Enter.

So far this piece of code works sometimes, and then stopped working.

My another thought is I could put my javascript functions in another client side js file and point to that file?

Could someone help please?

I managed to add my javascript code into a separated js file and including it using Helmet
Then from the Markdown html element, I just need to put the function’s name inside the event.

1 Like