I want to call a Java Script function inside following Thymeleaf and HTML code
<a class='btn btn-default btn-xs' href='#' role='button' th:id="view-notification">
View Notification
</a>
<a href="index.php?cat=notifications">
Notifications
<span class="badge" th:id="notification-badge">1</span>
</a>
This is my Java Script function which I have properly included (I hope so) in my html file
<th:block th:fragment="scripts">
<script th:inline="javascript">
$('#view-notification').click(function () {
$('#notification-badge').hide();
});
</script>
I inspected the html page and saw that js is not loading. What is wrong with my code?
Javascriptseems to usejQuery, did you include that as well?Javascriptis notJava!<script>block?