Uncaught ReferenceError when trying to call a onclick Function

I am working with Spring, Thymeleaf and Bootstrap and want to be able to display, edit and delete my University courses. For editing a course, I need to call a JavaScript function I have defined in courses.js. Currently I am just trying to log the course selected to the console in order to see if everything works properly. But when clicking on the edit button, I am getting: “Uncaught ReferenceError: editCourse is not defined at HTMLButtonElement.onclick”, even though I defined the function editCourse in courses.js. Here is my Code: