So, here\'s the deal: I have a JSON object saved in my web App at localStorage.
This JSON is being saved as a string, with JSON.stringify
, inside one of my function
I think there are a couple of errors in your code. Try this instead:
// it's class, not id, and no fullstop required.
// The $ sign was in the wrong place.
var transform = {tag:'option', class:'$(CODE)', html:'${NAMEVAR}'};
// it's innerHTML not innerHtml
document.getElementById('mySelectID').innerHTML = json2html.transform(jsonData, transform);