convert javascript code to jquery

-1

How would you look at this code in javascript:

 var ctx1 = document.getElementById("GraficoDonut1").getContext("2d");
    new Chart(ctx1).Doughnut(data1, options);
    legend(document.getElementById("lineLegend1"), data1);

In jQuery?

    
asked by anonymous 22.12.2016 / 20:27

1 answer

1

There's not much you can do in your code, just get the elements from #id via jQuery.

var ctx1 = $("#GraficoDonut1")[0].getContext("2d");
new Chart(ctx1).Doughnut(data1, options);
legend($("#lineLegend1")[0], data1);
    
22.12.2016 / 21:31