Home | Top | Website design | JavaScript Editor | Get Advanced JavaScript and Ajax Editor, Validator and Debugger! 1st JavaScript Editor. |
Moves content of a Range into a new node.
range = document.createRange(); newNode = document.createElement("p"): range.selectNode(document.getElementsByTagName("div").item(0)); range.surroundContents(newNode); |
surroundContents is equivalent to newNode.appendChild(range.extractContents());range.insertNode(newNode). After surrounding, the boundary points of the Range include newNode. (Hindered by http://bugzilla.mozilla.org/show_bug.cgi?id=135928 )
Home | Top | Website design | JavaScript Editor | Get Advanced JavaScript and Ajax Editor, Validator and Debugger! 1st JavaScript Editor. |