I have some code that is triggered by .change but I also need to trigger it onload and I'm not sure how I would do that. Any help would be great. Also this is a small example the real code is dynamic which is why I'm not using ids for the select list, there could be 1 or 100.
<script type="text/javascript">
$(function() {
$('select').change( function() {
$(this).closest('tr').find('.target').html(1.0-($(this).find(":selected").val()));
});
});
</script>
<table>
<tr>
<td><select>
<option value="0.1">0.1</option><option value="0.2">0.2</option>
</select></td>
<td class="target"></td>
</tr>
<tr>
<td><select>
<option value="0.1">0.1</option><option value="0.2">0.2</option>
</select></td>
<td class="target"></td>
</tr>
</table>