January 22, 201313 yr Hi, so as the topic suggests im looking to be pointed in the right direction on how to dynamically get an ID. $('.updateEasyPieChart').on('click', function(e) { e.preventDefault(); $('.percentage, .percentage-light').each(function() { var newValue = document.getElementById(1).innerHTML; $(this).data('easyPieChart').update(newValue); $('span', this).text(newValue); }); }); here is the piece of code which needs editing, im not looking for someone to do it for me, i want to do it myself...i would just like someone to give me some helpful info on how to do it. The 1 inside document.getElementById(1) Needs to be called dynamically throught the links below...the id of each link is sequential 1, 2, 3 etc...When that link/button is clicked, I somehow need the id of the link to be passed into the document.get...understand what i mean? <li><a href="#" id="1" class="button updateEasyPieChart">70</a></li> <li><a href="#" id="2" class="button updateEasyPieChart">60</a></li> <li><a href="#" id="3" class="button updateEasyPieChart">50</a></li> If you look here at this quick link, you can see what im basically trying to get working by clicking the button 70. When 70 is clicked, the value in the pie chart changes (none of the other work as it is calling only id 1) http://fifamatchgene...chart/examples/ Im not the best with javascript...so any help is appreciated. Thanks!
Create an account or sign in to comment