티스토리 뷰
728x90
반응형
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 객체를 찾는 의미이다.
참고
How to check if input file is empty in jQuery
Brand new to JS. I am trying to check if the file input element is empty when submitting the form with jQuery/JavaScript. I have gone through a bunch of solutions and nothing is working for me. I am
stackoverflow.com
What does $(selector)[0] mean in jQuery?
What does $(selector)[0] mean in jQuery?
The syntax that I don't understand is this: $("#profilePhotoFileUpload")[0] I have been seeing this syntax pretty frequently and I've ignored it for a while because I never had to use it. But now...
stackoverflow.com
728x90
반응형
댓글
250x250
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- k8s
- mybatis
- Spring
- claude
- Spring Security
- Bash tab
- LocalDateTime
- mybatis config
- Linux
- config-location
- 북리뷰
- input
- rocky
- LocalDate
- window
- elasticsearch
- Java
- localtime
- docker
- svn
- JavaScript
- 오라클
- intellij
- oracle
- maven
- 베리 심플
- Mac
- jQuery
- springboot
- Kotlin
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
29 | 30 |
글 보관함
반응형