J'ai extrait la valeur du titre comme vous pouvez le voir. Mais j'ai un problème avec l'addition. Fondamentalement, je ne sais pas comment ajouter chaque élément .work-day-graph dans .ct-chart. Donc ce sera comme 1,25 + 8,25 + 0,75 + 0,5 = XY et 2,25 + 7,25 + 2,75 + 0,5 = XY. Des idées ? Merci beaucoupAjout de la valeur d'extraction de la chaîne
DEMO: https://jsfiddle.net/1xn1eLfs/6/
JS:
$('.ct-chart').each(function() {
var graphTitle;
$(this).find('.work-day-graph').each(function() {
graphTitle = $(this).attr('title');
var graphTime = graphTitle.substring(graphTitle.lastIndexOf('(') + 1, graphTitle.lastIndexOf('h'));
//graphTimeVal = graphTime.parseInt();
$('<span class=output-val>' + graphTime + '</br>' + '</span>').appendTo('.output');
});
});