Thymeleaf javascript replacing an image source based on text in table
2 this is my first post. I have been trying to look for an answer that but I can't find one. I am trying to replace an image source in my HTML dependent on text displayed in the td.status, for example "SUBMITTED" My HTML : <table id = "myTable"> <tbody> <tr> <th>Reference</th> <th>Version</th> <th>Last Modified</th> <th>Status</th> </tr> <tr th:each="td: $thedata"> <td><span th:text="$td.thedataPrimaryKey.ref"></span></td> <td><span th:text="$td.thedataPrimaryKey.version"></span></td> <td><span th:text="$td.thedataTimestamp"></span></td> <td><span><img class="myImage" th:src="@/assets/images/offbulb.png" style="width:15px; height:10px"; /></span><span th:text="$td.status"></span