1
這裏是我試圖計算的jsfiddle。我不知道如何將這些字符串轉換爲整數。 http://jsfiddle.net/Ygsrv/2/jquery將數字視爲字符串
這裏是代碼:
$('#get').click(function(){
var priceProduct = 18.9
var length = $("#awp_group_5 option:selected").text().replace(/cm$/, '');
var width = $("#awp_group_4 option:selected").text().replace(/cm$/, '');
var priceProduct2 = priceProduct + (width + length * 30);
alert(priceProduct2);
});