Does anyone have the solution on this problem?
it is soposed to be <b> tags around a marked selection in a textfield but it won't work in Netscape 4.7
but in explorer.
<FORM NAME="myForm">
<TEXTAREA NAME="myArea" COLS="40" ROWS="4"></TEXTAREA>
<input type=button value="fet stil" onclick="fet()">
</FORM>
<script language="JavaScript">
function fet()
{
if (document.getSelection)
{
sel=document.getSelection //netskräp
}
else if (document.selection)
{
sel=document.selection //exploder
}
else
{
// annan browser
}
range=sel.createRange()
thetext=range.text
if (thetext.length)
{
range.text="<b>"+thetext+"</b>"
}
}
</script>
it is soposed to be <b> tags around a marked selection in a textfield but it won't work in Netscape 4.7
but in explorer.
<FORM NAME="myForm">
<TEXTAREA NAME="myArea" COLS="40" ROWS="4"></TEXTAREA>
<input type=button value="fet stil" onclick="fet()">
</FORM>
<script language="JavaScript">
function fet()
{
if (document.getSelection)
{
sel=document.getSelection //netskräp
}
else if (document.selection)
{
sel=document.selection //exploder
}
else
{
// annan browser
}
range=sel.createRange()
thetext=range.text
if (thetext.length)
{
range.text="<b>"+thetext+"</b>"
}
}
</script>