select change选中用法

js信息:

$(".wrapl").change(function () {

var s = this.options[this.selectedIndex].value;
$(this).prev().html(s);
});

 

html信息:

 <table>

<tr>

<td>

<label style="display: none">A</label>

<select class="wrapl">
<option>A</option>
<option>B</option>
<option>C</option>
</select> 
</td>

<td>

<label style="display: none">A</label>

<select class="wrapl">
<option>A</option>
<option>B</option>
<option>C</option>
</select> 
</td>

 

</table>

posted @ 2017-06-26 11:03  华季  阅读(2238)  评论(0编辑  收藏  举报