Javascript 체크 방법 if( document.getElementById("videoUploadFile").files.length == 0 ){ console.log("no files selected"); } jQuery 체크 방법 if ($('#videoUploadFile')[0].files.length === 0) { console.log("No files selected."); } jQuery에서 $(selector)[0] 이 가지는 의미는 선택된 요소의 첫 번째 DOM 객체를 찾는 의미이다. 참고 https://bit.ly/3mwSKur How to check if input file is empty in jQuery Brand new to JS. I am trying to check if..
input 태그 숫자 입력 시 세자리 수 콤마를 입력하게 하는 코드, 기존과는 다르게 jQuery를 사용해서 새로운 attribute를 만들고 HTML 의 input 태그에 아래와 같이 적용하면 된다. $(document).on('keyup','input[inputmode=numeric]',function(event){ this.value = this.value.replace(/[^0-9]/g,''); // 입력값이 숫자가 아니면 공백 this.value = this.value.replace(/,/g,''); // ,값 공백처리 this.value = this.value.replace(/\B(?=(\d{3})+(?!\d))/g, ","); // 정규식을 이용해서 3자리 마다 , 추가 }); 사용예제
- Total
- Today
- Yesterday
- Github Status
- Spring Security
- jQuery
- 베리 심플
- Linux
- LocalDateTime
- localtime
- docker
- JavaScript
- rocky
- mybatis
- window
- intellij
- 오라클
- Mac
- maven
- config-location
- mybatis config
- svn
- Bash tab
- oracle
- input
- Spring
- Kotlin
- springboot
- Java
- 북리뷰
- k8s
- LocalDate
- elasticsearch
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |