试试这个http://jsfiddle.net/KgAe4/4/:
<div class="simpleCart_shelfItem">
<img src="image/frod001.gif" alt="" />
<p class="item_name">Fishing rod model 001</p>
<span class="item_price">BND $189.95</span><br/>
Qty: <input type="text" class="item_quantity" value="1" style="width:20px;"/><br/>
<input type="button" onclick="javascript:calculateText();" id="calculateText" value="add to cart" />
</div>
jQuery
$("#calculateText").on("click", function(){
var price = $(".item_price").text();
var priceSplit = price.split("$");
var realprice = parseFloat(priceSplit[1]);
alert(realprice);
var quantity = $(".item_quantity").val();
alert(realprice*quantity);
});
Javascript
function calculateText(){
var price = document.getElementsByClassName("item_price")[0].innerHTML;
var priceSplit = price.split("$");
var realprice = parseFloat(priceSplit[1]);
var quantity = document.getElementsByClassName("item_quantity")[0].value;
alert(realprice*quantity);
}