How we can call start() JavaScript function for this case from HTML:
(function() {
var never, start;
never = function() {
return alert("try");
};
start = function() {
return alert("try harder");
};
}).call(this);
My HTML
<input type="button" value="press" onclick="never()" ></input>
When you assign event handler code to attributes, any functions that are used need to be available in the global variable scope.
To accomplish this, you can make them properties of
window. Currently, yourneverandstartfunctions are local to the IIFE function scope.You can expose a single namespace if you prefer
And then change your inline handler to use
ns.never();andns.start();.