I have this checkbox value: 10/07-08/24_NOV, and I have this code:
$(window).load(function() {
$('input:checkbox').change(function() {
var tot = 100;
$('input:checkbox:checked').each(function() {
tot -= parseInt($(this).val());
});
$('#outputDiv').html(tot)
});
});
I need jQuery to give me only the first value before the first delimiter, number 10.
Thanks!
You can use split() function to get the value before first
/,Live Demo