웹프로그래밍/프론트엔드(javascript, js, css)
javascript + jquery 잡지식들
발전하는개발자
2019. 4. 9. 10:21
현재 element의 id 값 가져오기
$(this).attr('id');
팝업 창을 열때
window.open('./#.php?param=','팝업창이름' ,'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,copyhistory=0,top=0,left=0,width=301,height=365');
팝업 창에서 적은 값을 parent window에 set 할 때
window.opener.document.getElementById('altContent').value = $("#smsMessage").val();
self.close(); // 팝업창 닫기
altContent 가 기존 창에 있는 input 태그의 ID
smsMessage 가 팝업창에 있는 textarea 태그의 ID
for문 jquery each 메소드
break -> return false;
continue -> return true;
javascript 특정 문자를 바꾸는데 모든 문자를 바꾸고 싶을 때 정규식 gi를 쓰고 . ^ () 를 치환할 때는 앞에 \를 붙인다
$('#dateTo').val().replace(/\./gi, "");
의미 -> dateTo 에서 모든 . 없앤다
반응형