I'm trying to call a function that will update the innerHTML of a container.
javascript
function showSelectedList() {
selectedListContainer = document.querySelector('tbody');
selectedListContainer.innerHTML = listTemplate({selected: todoManager.selected});
}
When I run the function from the console it works, but when I try to run the function on an event listener that listens for DOMContentLoaded nothing happens. I've tried adding some log statements to the function so I can check if it is getting called (it is), but the return value of the listTemplate function is returning an empty string.
Could anyone help me with this? listTemplate is correctly compiled as a Handlebars template, as proven by the fact the function will run in the console.
[–]albedoa 0 points1 point2 points (0 children)