전체 replace, 모든 공백 제거 > jquery

본문 바로가기

jquery

전체 replace, 모든 공백 제거

작성일 16-09-29 18:13

페이지 정보

작성자서방님 조회 130회 댓글 0건

본문

$('#id').val().replace(" """) -> 첫번째 공백 1개만 없어짐. 

$.trim($('#id').val()) -> 글자사이 공백은 안없어짐. 

 

$('#id').val().replace(/ /g, ''); -> 모든 공백 없어짐. 

$('#id').val().replace(/,/g, ''); -> 모든 콤마(,) 없어짐.

댓글목록

등록된 댓글이 없습니다.

게시물 검색
Copyright © 서방님.kr All rights reserved.
PC 버전으로 보기