티스토리 뷰

// 만약 jQuery를 사용한다면 아래의 사용자정의 trim(str) 대신 jQuery.trim(str) 사용
function trim(str) {
    return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
}

String.prototype.trim = function() {
    return this.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
}

// textarea 내용을 문장별 

태그 지정하여 HTML로 반환 function getTextareaHTML(textareaId) { return "

"+ document.getElementById(textareaId).value.trim().replace(/\n\r?/g,"

") +"

"; } document.Write( getTextareaHTML("content") );
댓글
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2025/08   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
글 보관함