paste to textarea
Her er den kode jeg bruger og det virker fint... Men hvordan laver jeg en past & cut.... jeg har fået copy..'????<script language="javascript">
<!--
function ahrefThis() {
strSelection = document.selection.createRange().text
if (strSelection == "") document.text.text.focus()
strHref = prompt("Enter the URL of the site you to link:","http://")
if (strHref == null) return;
document.selection.createRange().text = "<a href=\"" + strHref + "\" target=\"_blank\" class=\"text\">" + strSelection + "</a>"
return;
}
function boldThis(from) {
strSelection = document.selection.createRange().text
if (strSelection == "") {
document.text.text.focus()
if (from == 2) document.text.text.select()
strSelection = document.selection.createRange().text
document.selection.createRange().text = strSelection + "<b></b>"
}
else document.selection.createRange().text = "<b>" + strSelection + "</b>"
return;
}
function clipThis(from) {
strSelection = document.selection.createRange().text;
document.text.text.focus();
var dummy = document.text.text.value;
document.text.text.value = "";
if (dummy) {
document.selection.createRange().text = dummy + "\n\n<i>" + strSelection + "</i>";
}
else {
document.selection.createRange().text = "<i>" + strSelection + "</i>";
}
return;
}
function italicThis(from) {
strSelection = document.selection.createRange().text
if (strSelection == "") {
document.text.text.focus()
if (from == 2) document.text.text.select()
strSelection = document.selection.createRange().text
document.selection.createRange().text = strSelection + "<i></i>"
}
else document.selection.createRange().text = "<i>" + strSelection + "</i>"
return;
}
//-->
</script>
<script language="JavaScript">
<!--
if (document.selection) {
document.write('<span class="signature">highlight your text then click to <A title="Make a Link" href="java script:ahrefThis();" target=_self>LINK</A>, <A title=Bold href="java script:boldThis();" target=_self><B>BOLD</B></A> or <A title=Italicize href="java script:italicThis();" target=_self><I>ITALICIZE</I></A></span><br>')
}
//-->
</script><form name="form2" method="post" action="">
<textarea name="textarea"></textarea>
</form>
Håber i kan hjælpe :D
