i have below dynamic div tag structure into a form. i want to print a value into particular text field value among all.when particular link clicked. i have written my codes below.

```
<div id="main">
  <a href="some url" id="my_id-0">click</a>
  <div>
    <input type="textbox" id="my-input-0" class="input-class" value=""/>
  </div>
</div>
<div id="main">
  <a href="some url" id="my_id-1">click</a>
  <div>
    <input type="textbox" id="my-input-1" class="input-class"value="" />
  </div>
</div>
<div id="main">
  <a href="some url" id="my_id-2">click</a>
  <div>
    <input type="textbox" id="my-input-2" class="input-class" value=""/>
  </div>
</div>

```

what i exactly want is,
if clicked link with id of **my\_id-0**, a value for a text box near to clicked link should be added in a dynamic way. how do i do that?