Try changing: $('.numeric', this).each(function() { to: $('.numeric').each(function() {
On Oct 1, 11:06 am, nate <tresbordo...@gmail.com> wrote: > Hello > > I am trying to set up a toggle to allow users to show more precision > when a user clicks a button. I have a function high() that doesn't do > anything when it is called. I am fairly new to jQuery so I am not to > familiar with the syntax and am hoping that you can help me. > > var numeric_data = new Array(); > $('.numeric', this).each(function() { > data = parseFloat($(this).text()); > numeric_data.push(data) > > }); > > i = 0; > > this works > $('.numeric', this).each(function() { > data = numeric_data[i]; > data = data.toFixed(2); > $(this).text(data); > i++;}); > > i = 0; > > this doesn't work > high = function(){ > $('.numeric', this).each(function() { > data = numeric_data[i]; > data = data.toFixed(5); > $(this).text(data); > i++; > }); > > } > > high(); > > thanks, > > Nate