I've been building a custom SVG map of England and trying to have pieces of the array data appear at the bottom of the map. So far I've gotten the title to appear but keep getting 'undefined' for my description field.
My data is structured like this:
var regions = [ {'title':"Northeast England",'description':"<p>Paragraph</p><p>Does adding HTML here work?</p>", 'path' : "M219.02,6.876l-0.079,0.05l-0.482,0.371L218.23,7.47l-0.858,0.346h-0.008l-0.307,0.26l-0.779,0.666 l-0.104,0.278l-0.005,0.019l0.056,0.481l0.116,0.846l0.048,0.395l-0.344,1.05l-0.052-0.007v0.007l-0.635-0.081l-0.375,0.167 l-0.148,0.061v0.006l-0.1,0.328l0.178,........},
I want my description to contain a handful of paragraphs and some HTML to allow me to set up links to a related report.
The way that I'm attempting to generate the description in my JS is like this:
document.getElementById('title').innerHTML = title; document.getElementById('descr').innerHTML = description;
I've tried to define 'description' higher in the code but am not sure how to tie it to the field in the array/data that contains the information that I want to present on the page.
My full Codepen version of this is: http://codepen.io/msummers40/pen/wamMry
If you are able to help with this, thank you in advance.
Matt