It is not selection1, it is select which takes the value runtime. I missed to add single quote at last..but it is there in the code. I think my question is not clarified for you. I am calling function fun(), for loop executes and number of links will appear depending on the value of j.What i am trying to do is, i need to pass 'select' value for each links when i click the link but only final select value i.e for i=j, is going.so if i click any link only last select value(i=j) will go. i need 'select' values for all the valuse of i. Do i need to give id to anchor ? how to approach this?