Сообщение от Step48_rus
|
пробовал через if не получилось
|
Плохо пробовал...
Как вариант...
<!DOCTYPE html>
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=windows-1251' />
<script src='https://code.jquery.com/jquery-latest.js'></script>
<!--
<script src="https://code.angularjs.org/1.3.9/angular.min.js"></script>
<script src="https://code.angularjs.org/1.3.9/angular-route.js"></script>
-->
<style type='text/css'>
</style>
<script type='text/javascript'>
$(function(){
$('#mySelect, #mySelect2').change(test);
function test(){
var o={
'1_5': 1000,
'1_6': 2000,
'2_5': 4000
};
var key=$('#mySelect').val();
key+='_'+$('#mySelect2').val();
var val=o[key]? o[key]: '';
$('.price').text(val);
};
test();
});
</script>
</head>
<body>
<select id="mySelect">
<option value="1" id="tipe1">tipe1</option>
<option value="2" id="tipe2">tipe2</option>
<option value="3" id="tipe3">tipe3</option>
</select>
<select id="mySelect2">
<option value="5" id="mon1">mon1</option>
<option value="6" id="mon2">mon2</option>
<option value="7" id="mon3">mon3</option>
<option value="8" id="mon4">mon4</option>
</select>
<div class="price"></div>
</body>
</html>