dynamically generating js driving me crazy
I am dynamically generating html and js with this string:
- htmlStr+="<div class='list-group-item Specification' " +
- "onClick=displayResults(" + key + ", '" + time +
- "', '" + foodGroups + "')>";
In Chrome debugger it generates the html I want, where onclick=displayResults(1, '14:03', 'meat, veggies, fats')>
but in the final html that is generated the quotes are messed up and I don't understand why.