JQuery+JavaScript input 한글, 숫자, 영어만 입력
페이지 정보
- 작성자후야
- 조회 : 243
- 작성일 : 2021-01-28 00:19
본문
input 한글, 숫자, 영어만 입력
$(document).on("keyup", "input:text[KorOnly]", function() {$(this).val( $(this).val().replace(/[a-z0-9]|[ \[\]{}()<>?|`~!@#$%^&*-_+=,.;:\"\\]/g,"") );}); //한글만 입력
$(document).on("keyup", "input:text[numberOnly]", function() {$(this).val( $(this).val().replace(/[^0-9]/gi,"") );}); //숫자만 입력
$(document).on("keyup", "input:text[EngOnly]", function() {$(this).val( $(this).val().replace(/[0-9]|[^\!-z]/gi,"") );}); //영어만 입력
$(document).on("keyup", "input:text[EngOnly]", function() {$(this).val( $(this).val().replace(/[0-9]|[^\!-z\s]/gi,"") );}); //엉어, 띄어쓰 입력
- 이전글Colorpicker - Spectrum 2021.01.28
- 다음글JQuery 차트 - billboard.js 2021.01.28