How to pass each id from JSP to javascript? : In our JSP application, we are creating a html buttons in for loop. Say, for example,

<%for(int i=0;i<5;i++){%>
<input type="button" class="btn-success btn-rounded" id ="?????"  value="abcd" onclick="changeButton()">

Now i want pass each button's id to javascript method , but it doesnt works.
Currently, the first button's id is passed.How to pass each button's id to javascript ?