Reputation: 49
I could not do that when put in a value being placed on the input attribute "data-value" here is my attempt:
$('.enviar').on('click', function(){
var bla = $('input').val();
$("#canPIE").data("values", bla);
});
Upvotes: 0
Views: 52
Reputation: 2815
Have a look at this Fiddle
$('.enviar').on('click', function(){
var bla = $('input').val();
$("#canPie").attr("data-values", $("#canPie").attr("data-values") + "," + bla);
drawPieChart('canPie');
});
Upvotes: 1