小唯快跑啊
试一下 ContentEditable 这个属性。看一下这个 Demo:HTML5 Demo: ContentEditablehttp://html5demos.com/contenteditable相关代码:123456var editable = document.getElementById('editable');addEvent(editable, 'blur', function () { // lame that we're hooking the blur event localStorage.setItem('contenteditable', this.innerHTML); document.designMode = 'off';});addEvent(editable, 'focus', function () { document.designMode = 'on';});if (localStorage.getItem('contenteditable')) { editable.innerHTML = localStorage.getItem('contenteditable');} 不过,建议用JQuery比较好,而且简单,Jquery有个属性,直接可以获取当前元素的所有子元素