Change details of an element whose id is constructed from variables
Dear all
I am having a table
- <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>Product id</td>
<td>name</td>
<td>Detail</td>
<td>remarks</td>
<td>process</td>
</tr>
<tr>
<td id="11">11</td>
<td>21</td>
<td>31</td>
<td id='process11'>41</td>
<td> </td>
</tr>
<tr>
<td id="12">12</td>
<td>22</td>
<td>32</td>
<td id='process12'>42</td>
<td> </td>
</tr>
<tr>
<td id="13">13</td>
<td>23</td>
<td>33</td>
<td id='process13'>43</td>
<td> </td>
</tr>
<tr>
<td id="14">14</td>
<td>24</td>
<td>34</td>
<td id='process14'>44</td>
<td> </td>
</tr>
</table>
When a person click on product id i want top display "foo" in column process for the product row clicked
Assume a person clicks where productid=11
I get product id as 11 easily
Let us assign this to productid
- var productid =this.id
now I want to display foo for id = 'process11'
to do this
i tried form the variable name as follow
- var pid='#'+'process'+productid // this forms the id of element i want to change / update
and tried
- $(pid).text('foo')
with no success
pls help