Man koennte das mit DOM-Manipulation machen:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<html>
<head>
<title>Test</title>
<script>
var savedElement;
function toggle() {
var elem = document.getElementById("zwei");
if (elem) {
savedElement = elem.parentNode.removeChild(elem);
} else {
var container = document.getElementById("container");
var drei = document.getElementById("drei");
container.insertBefore(savedElement, drei);
}
}
</script>
</head>
<body id="container">
<div><a href="javascript:toggle()">Toggle</a></div>
<div id="eins">Eins</div>
<div id="zwei">Zwei</div>
<div id="drei">Drei</div>
</html>