<!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); | |
Selection_setEmptySelectionAt(document.body,0); | |
Cursor_insertCharacter("X"); | |
showSelection(); | |
} | |
</script> | |
</head> | |
<body> | |
<p>Sample text</p> | |
</body> | |
</html> |