我不知道如何简化以下代码。以这种方式复制代码似乎是多余的。它用于http://boboco.techef.net/express.php
$('#squareDrop').change(function(){
var squarePriceCurrent = $('#squarePrice').text();
var squarePrice = $('#squareDrop option:selected').attr('title');
$('#squarePrice').increment(squarePriceCurrent, squarePrice);
$('#squareTotal').val(squarePrice + '.99');
});
$('#portraitDrop').change(function(){
var portraitPriceCurrent = $('#portraitPrice').text();
var portraitPrice = $('#portraitDrop option:selected').attr('title');
$('#portraitPrice').increment(portraitPriceCurrent, portraitPrice);
$('#portraitTotal').val(portraitPrice + '.99');
});
$('#landscapeDrop').change(function(){
var landscapePriceCurrent = $('#landscapePrice').text();
var landscapePrice = $('#landscapeDrop option:selected').attr('title');
$('#landscapePrice').increment(landscapePriceCurrent, landscapePrice);
$('#landscapeTotal').val(landscapePrice + '.99');
});