I briefly ran into an issue myself trying to reproduce your problem - the issue being that I didn't have <table>
tags around the <td>
field, at which point the field simply wasn't recognized and I could not get its contents by ID. But as you can see at the following fiddle http://jsfiddle.net/eup3y/3/ using a number for the ID, whilst not recommended, is not the problem (if you are using HTML5 - for older browsers that's not true as the spec required the ID to start with a letter).
In order to debug, I recommend that you break this into smaller pieces (that usually is a good idea):
If you can't, then make sure that you have valid HTML in the region around your table. In particular make sure there are opening and closing <table>
tags around it. If the HTML didn't parse correctly, you can't extract the elements by ID
- Can you create the chart element that you want when you hard code the value (instead of looking up the value
19
as you are doing now)
My hunch is that your HTML doesn't parse properly. If you open the page with an error console open, you will find the error quickly I imagine.