Måske kan denne leges med ?
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
http://www.w3.org/TR/html4/loose.dtd"><head><meta http-equiv="content-type" content="text/html; charset=iso-8859-1"><title>Ingen titel</title>
<script type="text/javascript">
<!--
function switchdis(tmpid){
tn=document.getElementById(tmpid);
tn.style.display=(tn.style.display=="none")?"block":"none";
}
window.onload=function(){
tn=document.getElementById("box1");
tn2=document.getElementById("button1");
tn.style.top=tn2.offsetTop+"px";
tn.style.left=tn2.offsetLeft+"px";
tn.style.width=tn2.offsetWidth+"px";
}
mytxt="";
mytxts="";
mytxte="";
mycurtxtl="";
myvalue="";
function findselect(mytag){
mytxtarea=document.formnavn.txtareanavn;
if(document.selection){
mytxt=document.selection.createRange().text;
if(mytxt!="")document.selection.createRange().text="["+mytag+"]"+mytxt+"[/"+mytag+"]";
}else if((mytxtarea.selectionEnd-mytxtarea.selectionStart)>0){
mytxts=mytxtarea.selectionStart;
mytxte=mytxtarea.selectionEnd;
mycurtxtl=mytxtarea.textLength;
myvalue=mytxtarea.value;
mytxtarea.value=mytxtarea.value.substr(0,mytxts)+"["+mytag+"]"+mytxtarea.value.substr(mytxts,mytxte-mytxts)+"[/"+mytag+"]"+mytxtarea.value.substr(mytxte,mycurtxtl);
}
}
//-->
</script></head><body>
<form method="POST" action="#" name="formnavn" style="position:relative;">
<textarea rows="5" name="txtareanavn" cols="20"></textarea><br>
<button id="button1" onclick="switchdis('box1');return false;">Skift</button>
<div id="box1" class="dropdownbox" style="position:absolute;top:0px;left:0px;display:none;">
<input type="button" onclick="findselect('b');switchdis('box1');" value="Fed skrift">
<input type="button" onclick="findselect('i');switchdis('box1');" value="Kursiv skrift">
<input type="button" onclick="findselect('u');switchdis('box1');" value="Understreget skrift">
</div>
</form>
</body></html>