Notice
Recent Posts
Recent Comments
Link
목록blur (1)
kimmgamjja
[JavaScript] selectbox 변경 시 이전 값 확인하기
selectbox 변경( change 이벤트가 발생하기 ) 전 seletbox 값을 확인하는 방법 - change 이벤트 전에 focus이벤트를 줘서 값을 확인하면 된다$("select[name='test']").on('focus', function () { console.log("before: "+this.value);}).change(function() { $(this).blur(); console.log("after: "+this.value);}); * focus() - 요소가 포커스를 받을 때 발생 ex)$("select[name='test']").on('focus', function () { console.log("포커스 이벤트");}); name이 test인 selectbox를 클릭했을 때..
공부/JavaScript
2025. 1. 23. 09:46