问题
I have code inside a .hbs file like this
{{ # each content }}
.....
<input name = "a" type="text" id="a_id" />
<button onclick="my_fn(a)"> BUTTON </button>
{{/each}}
Inside the code I have defined a button clicking which I want to call
another function:
function my_fn(a){
alert("Hi"+ a);
}
where "a" is the user input. This way I'm unable to send argument to "my_fn". How this can be done.
来源:https://stackoverflow.com/questions/37837450/taking-input-from-inside-handlebar-hbs-file