한글만 되게 하는 자바스크립트 입니다.

· 10년 전 · 268

<SCRIPT LANGUAGE="JavaScript">    
function enforceHanGul() {  
if(window.event.type == "propertychange" ){  
if ( window.event.propertyName == "value" ) {   
 var pattern = /[^(ㄱ-힣)]/g;   
 if(pattern.test(window.event.srcElement.value)){  
var v = window.event.srcElement.value.replace(pattern, "");  
window.event.srcElement.value = window.event.srcElement.value.replace(pattern, "");  
}  
}  
}  
}   
</SCRIPT>  
<input style="ime-mode:active" onfocus="this.style.imeMode='active'" onkeydown="this.focus()" onpropertychange='enforceHanGul()'>

|
댓글을 작성하시려면 로그인이 필요합니다.

팁게시판

디자인과 관련된 유용한 정보를 공유하세요. 질문은 상단의 QA에서 해주시기 바랍니다.

+
제목 글쓴이 날짜 조회
10년 전 조회 262
10년 전 조회 313
10년 전 조회 247
10년 전 조회 309
10년 전 조회 247
10년 전 조회 343
10년 전 조회 269
10년 전 조회 279
10년 전 조회 219
10년 전 조회 301
10년 전 조회 261
10년 전 조회 269
10년 전 조회 269
10년 전 조회 285
10년 전 조회 282
10년 전 조회 764
10년 전 조회 245
10년 전 조회 264
10년 전 조회 172
10년 전 조회 707
10년 전 조회 308
10년 전 조회 287
10년 전 조회 347
10년 전 조회 355
10년 전 조회 385
🐛 버그신고