[jQuery] match() 함수(특정 문자 포함 여부)

💻 MDN Web DOC

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match

 

String.prototype.match() - JavaScript | MDN

The match() method retrieves the result of matching a string against a regular expression.

developer.mozilla.org

 

💻 특정 문자 포함여부 체크

 var telValue = $('#tel').val();
 if ( telValue.match("-")) {
      alert('-을 제거해주세요.');
      return false;
 }

 

댓글

Designed by JB FACTORY