Easy way is to split() the checkbox value.
var val = thisInput.value, // "bgh_9.99"
split_array = val.split("_"), // ["bgh", "9.99"]
number = split_array[1]; // "9.99"
sum += parseFloat(number); // 9.99
More Related Contents:
- How do you modify a file using JavaScript together with PHP?
- i am not getting dropdown with this code [duplicate]
- Apply a smarty modifier to JS?
- http request has been block from https
- download file using an ajax request
- Submit form without page reloading
- how to bypass Access-Control-Allow-Origin?
- Scrape web page data generated by javascript
- JavaScript does not fire after appending [duplicate]
- AJAX jQuery refresh div every 5 seconds
- Has Facebook sharer.php changed to no longer accept detailed parameters?
- How to display pie chart data values of each slice in chart.js
- Only on Firefox “Loading failed for the with source”
- For a push notification, is a websocket mandatory?
- json_encode not preserving order
- send json object from javascript to php
- How can I return a view from an AJAX call in Laravel 5?
- how to upload and delete files from dropzone.js
- How to use jquery $.post() method to submit form values [duplicate]
- Using JavaScript to display Laravel’s Variable [duplicate]
- Get element’s ID and set it as variable
- Chained Select Boxes (Country, State, City)
- How to make a button execute a php script?
- SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
- Set cookie on multiple domains with PHP or JavaScript
- Remove everything within script and style tags
- Axios request giving getter setter methods instead of data queried
- How do I execute a PHP query on select option choice using AJAX?
- Preg_match to regex equivalent expression to match any Unicode letters
- How to return an array from an AJAX call?