her er min kode
<head>
<script>
function Init()
{
editor = document.getElementById("Editor");
editor.contentWindow.document.designMode = "On";
document.getElementById('tip').style.visibility = 'hidden';
}
function txtCommand(command, value)
{
editor.contentWindow.document.execCommand(command, false, value);
document.getElementById('size').innerHTML = "<img src='size.png' onclick='size()'>";
}
function vis()
{
document.getElementById("kode").value = editor.contentWindow.document.body.innerHTML;
}
function tip()
{
document.getElementById('tip').style.visibility = 'visible';
document.getElementById('tipknap').href = 'JavaScript:tipoff()';
}
function tipoff()
{
document.getElementById('tip').style.visibility = 'hidden';
document.getElementById('tipknap').href = 'JavaScript:tip()';
}
</script>
</head>
<body onload="Init()">
<div style="background-color:99CCFF;width:504px;border-width:1px;border-style:solid;margin:2px;">
<img src="http://itgeeks.dk/test/bold.png" onclick='txtCommand("Bold", "");' width="20" height="20" style="margin:2px;margin-bottom:0px;margin-right:0px;">
<img src="http://itgeeks.dk/test/underline.png" onclick='txtCommand("Underline", "");' width="20" height="20" style="margin:2px;margin-bottom:0px;margin-right:0px;">
<img src="http://itgeeks.dk/test/italic.png" onclick='txtCommand("Italic", "");' width="20" height="20" style="margin:2px;margin-bottom:0px;margin-right:0px;">
<img src="http://itgeeks.dk/test/left.png" onclick='txtCommand("JustifyLeft", "");' width="20" height="20" style="margin:2px;margin-bottom:0px;margin-right:0px;">
<img src="http://itgeeks.dk/test/center.png" onclick='txtCommand("JustifyCenter", "");' width="20" height="20" style="margin:2px;margin-bottom:0px;margin-right:0px;">
<img src="http://itgeeks.dk/test/right.png" onclick='txtCommand("JustifyRight", "");' width="20" height="20" style="margin:2px;margin-bottom:0px;margin-right:0px;">
<select onchange='txtCommand("FontSize", this.options[this.selectedIndex].value);'>
<option value="1">10</option>
<option value="2">12</option>
<option value="3">14</option>
<option value="4">18</option>
<option value="5">24</option>
<option value="6">32</option>
<option value="7">48</option>
</select>
<a href="JavaScript:tip()" id="tipknap" style="float:right;margin:5px;color:white;text-decoration:none;">Tip</a><br>
<iframe id="Editor" FRAMEBORDER="NO" style="width:500px;height:300px;background-color:white;margin:2px;margin-top:0px;"></iframe>
<span id="tip" style="visibility:hidden;">
Her er et tip :)<br>
Her er et tip :)<br>
Her er et tip :)<br>
Her er et tip :)<br>
Her er et tip :)<br>
</span>
</div>
<br><button onclick='vis();'>Vis kode</button><br>
<textarea id="kode" style="width:500px;height:300px;"></textarea>