Pass dynamic data to JS function

need to pass the value of a sc.data field to a JS.Function for eval and then it will return a correct text to display, please advise the proper syntax

document.getElementById("result").innerHTML = merritcourse(dmx.app.data.serverconnect.data.courseTitle,dmx.app.data.serverconnect.data.meritCourseTitle,dmx.app.data.serverconnect.data.employeeName);

Assign the value to a form input field (hidden) and use that value in the JS function.

Please check the following topics, this has already been discussed in our community:

thanks for the help, found my issue.

correct syntax:

<p id="result"></p> <script>
                 document.getElementById("result").innerHTML = merritcourse('{{courseTitle}}','{{meritCourseTitle}}','{{employeeName}}');
                </script>