You should modify your question " A function call inside of the h1 tag? " instead of A function inside of the h1 tag?
JavaScript functions can be invoked in HTML in a few distinct ways:
Inline Event Handlers : Using attributes like onclick, onchange.
Event Listeners : Via JavaScript's addEventListener method.
Inline Script : By including the script directly within the HTML file using tags.
External Script : Linking an external JavaScript file using the src attribute within tags.