textarea 에 있는 내용을 div 태그로 바꿔서 보여주는 함수 > script

본문 바로가기

script

textarea 에 있는 내용을 div 태그로 바꿔서 보여주는 함수

작성일 06-09-20 18:00

페이지 정보

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

본문

귀찮아서...주석 생략...잘 야려봐라.. -_-;;; 뭔가 보일것이니...

 

// 보기 모드 전환 textarea -> div 로 태그로...
function fnViewModeToggle(obj) {
    var tmpVal = obj.innerText;
    var n_obj_nm = "_tmp_hid_"+obj.name;
    var n_obj;

    if (obj.style.display == "") {
        tmpVal = tmpVal.replace(/n/gi,"<br>");
        tmpVal = "<div id="+n_obj_nm+">"+tmpVal+"</div>";
        obj.insertAdjacentHTML("afterEnd", tmpVal);
        obj.style.display = "none";

    } else {
        n_obj = eval(n_obj_nm);
        n_obj.removeNode(true);
        obj.style.display = "";
    }
}


http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/methods/insertbefore.asp

댓글목록

등록된 댓글이 없습니다.

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