creatElement,appendChild 및 기타 기능의 새로운 기능입니다! 헤헤! 이런 글을 쓰는 것은 전문가들에게는 매우 미성숙해 보일 수도 있습니다! 하지만 나는 그것을 완전히 직접 썼습니다! 아직 완벽하지 않습니다. 지도 부탁드립니다! ! " -//W3C//DTD HTML 4.0 Transitional//EN"> 스타일> ; .test{border:1px solid #ccc;배경색:#eee;width:200px;height:60px;} <!-- </U> function isIE(){ //즉, </a> if (window.navigator.userAgent.indexOf("MSIE")>=1) return true; else return false </a></span>} </div>if(!isIE()){ //firefox innerText 정의 <div class="codebody" id="code84101"> HTMLElement.prototype.__defineGetter__("innerText", <br> function(){ <br> 이것을 반환합니다. textContent ; <br> } <br> ); <br> HTMLElement.prototype.__defineSetter__("innerText", <br> function(sText){ <br> this.textContent=sText; <br> 🎜>}함수 $( e){ <br> return document.getElementById(e); <br> } <br> var arr=new Array() <br> function check(e){ <br> var v= 0; (i=0;i<arr.length;i ) <BR> {if(arr[i]==e) v=1; <BR> else v=0;} <BR> if (v) return true; <BR> else return false; <BR> } <BR> function edit(e){ <BR> var x=$(e) <BR> var str=x.innerText; ) <BR> { <BR> //alert("배열에 이미 존재합니다! "); <BR> //alert(str); <BR> var b=$(e "fa"); <BR> str=$(e "faz").value; <BR> b.removeChild($ (e "faz")); <BR> x.innerText=str; <BR> }else{ <BR> div"); <BR> a1.id=e "fa"; <BR> a=document.createElement ("INPUT"); <BR> a.name=e; <BR> a.value=str; <BR> x .appendChild(a1); <BR> a1.appendChild(a); <BR> if(arr.length== 0) arr[0]=e <BR> else arr[arr.length]=e; > //경고(a.name); <BR> } <BR> --> > 편집 가능한 콘텐츠 편집 가능한 콘텐츠 < ;/BODY> 브라우저 문제를 해결하기 위한 최종 코드 새 문서 body{font-size:14px;} input{border:none;font-size:14px;} .show{border:1px solid #ccc;background-color:#eee;width:150px;height:20px;} .hide{border:1px solid #ccc;background-color:#eee;width:150px;height:20px;display:none;} 잘! ! 바쁜 밤을 보낸 후, 바로 이것입니다! ! 히히히히히히 우울한! Firefox에서는 DOM의 작은 차이로 인해 태그 내의 공백을 제외한 입력이 포함된 div childNodes[0]을 사용하기 때문에 공백이 있으면 안 됩니다! 그렇지 않으면 두 번 클릭해야 합니다! 편집 가능한 콘텐츠 1 편집 가능한 콘텐츠 2 편집 가능한 콘텐츠 3 편집 가능한 콘텐츠 4개 [Ctrl A 모두 선택 참고: 외부 J를 도입해야 하는 경우 실행하려면 새로 고쳐야 합니다 ] <!-- function $(e){ return document.getElementById(e);//封装获取函数 } function edit(e){ //parseInt $(e).style.display="none"; $(e+"fm").style.display="block"; $(e+"fm").childNodes[0].focus(); //div的子元素自动获得焦点 } function hide(e){ //parseInt $(e).style.display="none"; $(e=e.replace("fm","")).style.display="block"; } -->