问题
How to take user input from a handlebar template .hbs file and send it to some other js function as argument
I have tried so far:
{{ # each content }}
<tr role="row">
.....
<td
<input name = "a" type="text" id="a_id" />
</td>
<td>
<button onclick="my_fn(a)"> SUBMIT </button>
</td>
</tr>
{{/each}}
For each data content there a row is created by this template .hbs file, in each row there is a field for taking user input and after entering text input a SUBMIT
button is there in each row,clicking which a js function is called. the user input sent to the function "my_fn"
as argument.
来源:https://stackoverflow.com/questions/37850038/taking-input-from-inside-handlebar-template-file-hbs