I have this html:
<div id="list1">info needed for jquery script</div>
<tr>
<td><button class="button green">Click Me</button></td>
<td></td>
<td></td>
</tr>
<div id="list2">info needed for jquery script</div>
<tr>
<td><button class="button green">Click Me</button></td>
<td></td>
<td></td>
</tr>
If someone clicked the click me button, how can I get the div before the tr based on the button they clicked? So if they clicked the first click me it gets the value of list1, if they click the second Click Me button it gets the content in the div called list2. The id for the div is dynamically created so it could be list25 or list100. But it will always start with the word list followed by a numeric value.
Ignoring the invalid divs inside the table;