select on change and current row?
Posted: Thu Mar 26, 2015 10:56 am
I have a table , the rows are select from db, the rows is dynamic , and I want my fist td''s value control my second td's value . I have the following code, how can I let my script know which row I click?
Code: Select all
<tr id =1><td><select id="exam_type">
<option>--Select--</option>
<option>exam 1</option>
<option>exam2</option>
<option>exam3</option>
</select>
<label>Select Grade:</label>
<select id="grade">
<!-- Dependent Select option field -->
</select>
</div>
<tr id =2><td><select id="exam_type">
<option>--Select--</option>
<option>exam 3</option>
<option>exam2</option>
<option>exam4</option>
</select>
<label>Select Grade:</label>
<select id="grade">
<!-- Dependent Select option field -->
</select>
</div>
</td></tr>
more tr
$("#id" +?).change(function(){
// Do something here.
}