html : 태그 안에 value 속성으로 thymeleaf 값 불러오기

김선미·2022년 7월 27일
0

태그 속성 : value

html 태그의 value 속성과 thymeleaf 를 이용해 유저의 변경 전 정보를 태그 안에 불러올 수 있다.

input 태그

value 속성 안에 불러올 값을 지정한다.

<input id="input-user_name" class="input" type="text" 
placeholder="별명" th:value="${userInfo.nickname}" >

textarea 태그

textarea 태그는 value 만으로 thymeleaf 변수를 불러오지 못하기 때문에 text 속성도 같이 사용해야 한다.

<textarea id="textarea-about" class="textarea" placeholder="자기소개하기"
th:value="${userInfo.statusMessage}" th:text="${userInfo.statusMessage}">
</textarea>
profile
백엔드 개발 공부

0개의 댓글