기본 문법 jQuery.trim(str) .trim() 메서드 사용 예시 참고자료 : https://api.jquery.com/jQuery.trim/ jQuery.trim() | jQuery API Documentation Description: Remove the whitespace from the beginning and end of a string. Note: This API has been deprecated in jQuery 3.5; please use the native String.prototype.trim method instead. Unlike jQuery.trim, String.prototype.trim does not work with types othe api.jquery.com
trim
trim() 사용방법 주의 사항 : IE8 혹은 그 이하 자바 스크립트에서는 trim() 이 지원되지 않는다. jQuery 라이브러리를 사용하고 있다면 .. $.trim('str '); jQuery 라이브러리를 사용 하지 않는다면. .. 함수를 만들어서 사용하기 !! function trim(str) { return str.replace(/(^\s*)|(\s*$)/gi, ''); }