i want to call a function using button
here is my sample code
<input type="button" value="click" onclick="test()">
function test() {
alert("test");
}
here is my error
(index):39 Uncaught ReferenceError: test is not defined
at HTMLInputElement.onclick ((index):39)
onclick @ (index):39
sample preview https://jsfiddle.net/d102791estiny/1b68eLdr/16745/