| <!DOCTYPE html> |
| <html> |
| <head> |
| <script> |
| function deleteNeighbours(node) |
| { |
| while (node.previousSibling != null) |
| DOM_deleteNode(node.previousSibling); |
| while (node.nextSibling != null) |
| DOM_deleteNode(node.nextSibling); |
| } |
| |
| function performTest() |
| { |
| var p = document.getElementsByTagName("P")[0]; |
| deleteNeighbours(p); |
| |
| DOM_insertBefore(document.body,DOM_createTextNode(document," "),p); |
| DOM_insertBefore(document.body,DOM_createTextNode(document," "),p); |
| DOM_insertBefore(document.body,DOM_createTextNode(document," "),p); |
| |
| Selection_setEmptySelectionAt(document.body,0); |
| |
| Cursor_insertCharacter("X"); |
| showSelection(); |
| } |
| </script> |
| </head> |
| <body> |
| <p>Sample text</p> |
| </body> |
| </html> |