user464180
user464180

Reputation: 1359

Struts 2: Set ID of <td> to iterator value?

I have the following code, how do I go about setting the ID of the TD equal to that of the Year that is returned from my list (iterator)? I need this so I can then perform JavaScript functions on the table/TD (hide/show...).

<table id="earningtesttable">
       <s:iterator value="earningsTest">
            <tr>
               <td id=""> <!--I want to set the id also equal to the year-->
                    Year: <b><s:property value="year" /></b>
               </td>
            </tr>
       </s:iterator>
</table>

Thanks!

Upvotes: 0

Views: 1306

Answers (1)

Quaternion
Quaternion

Reputation: 10458

<td id="<s:property value="year" />">

Upvotes: 1

Related Questions