0
 <div class="alert alert-warning alert-dismissible " aria-hidden="true">
       <button type="button" class="close " aria-hidden="true" data-dismiss="alert">&times;</button>
       <strong th:text="${error}"></strong>
 </div>

Though I have used aria-hidden="true" the alert keeps showing on the page load as it is shown in the image. Any quick advice please?

image

GeekySelene
  • 847
  • 3
  • 13
  • 31

1 Answers1

0

From this wonderful answer

The aria-hidden property tells screen-readers if they should ignore the element

What you want is to hide the element if there is no error. For this, use

th:if="${error}"

on your <div> element.

Phil
  • 157,677
  • 23
  • 242
  • 245