基于以下代码,我有不同的选择框:
$("select").each(function(){
var select = $(this).css('opacity', 000);
var select = $(this).css('width', 200);
select.wrap('<span class="select"/>');
select.before('<span class="value"><span></span></span>');
var selectVal = select.siblings(".value").find("span");
function selectUpdate() {
var newVal = select.find(':selected').text();
selectVal.html(newVal);
}
select.bind('change keypress keydown keyup', selectUpdate);
selectUpdate();
});
我有两个selectbox,当selectbox 1 ==某物上的值时,selectbox 2必须将其值更改为sometherse
<select name="tbz" id="tbz">
<option value="1">1</option>
<option value="something">2</option>
</select>
<select name="prc" id="prc">
<option value="1">1</option>
<option value="somethingelse">2</option>
</select>
我怎样才能使这项工作?