# readonly
<input readonly type="text">
# input 태그에 value 넣기
<input type="text" value="" name="inputValue"/>
$('input[name=inputValue]').attr('value',"test");
-> <input type="text" value="test" name="inputValue"/>
var price = 10000;
price.toLocaleString(); // 10,000
function getParams() {
const curUrl = window.location.href;
const url = new URL(curUrl);
const urlParams = url.searchParams;
let weekdayPrice = urlParams.get('weekdayPrice');
let weekendPrice = urlParams.get('weekendPrice');
console.log(weekdayPrice);
$('#eventPrice').val(eventPrice(weekdayPrice, weekendPrice));
}
function getDatesStartToLast() {
let startDate = document.getElementById('datePicker-start').value;
let lastDate = document.getElementById('datePicker-end').value;
let curDate = new Date(startDate);
while (curDate <= new Date(lastDate)) {
results.push(curDate.toISOString().split("T")[0]);
curDate.setDate(curDate.getDate() + 1);
}
findDate(results);
}
<input id="datePicker-start" type="text" th:field="*{eventStartDate}" class="form-control" placeholder="시작일">
<input id="datePicker-end" th:field="*{eventEndDate}" class="form-control" placehold="종료일">
input readonly
input에 value 넣기
현재 페이지 URL 가져오기
필요 파라미터 가져오기
onchange 함수
타임리프 자바스크립트 변수 사용 - 예약된 날짜 처리
타임리프 기본기능
input 태그의 값을 함수의 변수로 사용