기본 문법 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
jQuery
trim() 사용방법 주의 사항 : IE8 혹은 그 이하 자바 스크립트에서는 trim() 이 지원되지 않는다. jQuery 라이브러리를 사용하고 있다면 .. $.trim('str '); jQuery 라이브러리를 사용 하지 않는다면. .. 함수를 만들어서 사용하기 !! function trim(str) { return str.replace(/(^\s*)|(\s*$)/gi, ''); }
기본문법 .attr( attributeName ) .attr( attributeName ) 메서드 사용 예시 Check me 참고자료 : https://api.jquery.com/attr/ .attr() | jQuery API Documentation Description: Get the value of an attribute for the first element in the set of matched elements. The .attr() method gets the attribute value for only the first element in the matched set. To get the value for each element individually, use a looping constr ..