I have created a function, inside of a JS file, that changes the innerHTML using template literals when I press a button.
In the example below ${ title }
is expected to change when I press the button.
element.innerHTML = {{ range (where .Data.Pages "Title" **"${ title }"**) }}{{ .Name }}{{ .Content }}{{ end }}
The output, rendering on my page, returns this…
{{ range (where .Data.Pages "Title" "${ 1. Introduction }") }}{{ .Name }}{{ .Content }}{{ end }}
instead of this…
- Introduction
Integer euismod lacus luctus magna. Quisque cursus, metus vitae pharetra auctor, sem massa mattis sem.
Is there a way to tell hugo to change the InnerHTML in JS, while keeping its variable display capability inside of HTML?