Rich Text Editor Code

Source: Internet
Author: User

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>
<title> Untitled Document </title>
<script language= "JavaScript" >
function Dobold () {
Doc.execcommand (' Bold ');
Editor.focus ();
}
function Doitalic () {
Doc.execcommand (' Italic ');
Editor.focus ();
}
function Dounderline () {
Doc.execcommand (' underline ');
Editor.focus ();
}
function Dostrikethrough () {
Doc.execcommand (' strikethrough ');
Editor.focus ();
}
function Docut () {
Doc.execcommand (' Cut ');
Editor.focus ();
}
function Docopy () {
Doc.execcommand (' Copy ');
Editor.focus ();
}
function Dopaste () {
Doc.execcommand (' Paste ');
Editor.focus ();
}
function Doundo () {
Doc.execcommand (' Undo ');
Editor.focus ();
}
function Doprint () {
Doc.execcommand (' Print ');
Editor.focus ();
}

function Dosubscript () {
Doc.execcommand (' subscript ');
Editor.focus ();
}
function Dosuperscript () {
Doc.execcommand (' superscript ');
Editor.focus ();
}

function Seepreview () {
Doc.body.innerhtml=form1. Preview.value;
return false;
}

function Editresource () {
Form1. preview.value=doc.body.innerhtml;
return false;
}
</script>
<body>
Rich Text editor <p>
<a href= "Javascript:doundo (); > Recovery </a>&nbsp;<a href= "Javascript:doprint (); > Printing </a>
&nbsp;<a href= "Javascript:docut (); > Shear </a>&nbsp;<a href= "javascript:docopy (); > Replication </a>&nbsp;
<a href= "Javascript:dopaste (); > Paste </a>&nbsp;

<br>
<a href= "Javascript:dobold (); > Coarse </a>&nbsp; <a href= "Javascript:doitalic (); > Oblique </a>&nbsp;<a href= "javascript:dounderline ();" ><u> down </u> </a>&nbsp;
<a href= "Javascript:dosuperscript (); ><u> superscript </u> </a>&nbsp;<a href= "Javascript:dosubscript (); ><u> Subscript </u> </a>&nbsp;
<a href= "Javascript:dostrikethrough (); > <strike> Middle Row </strike></a>&nbsp;
Centre left center Right indent indent picture Insert Connection
<br>

<form id=form1 method= "POST" action= "edit-m.htm?val= ' Javascript:docv; '" >
<iframe id=editor style= "width:100%; height:150px;
Src= "About:blank" ></IFRAME>
<button id=mxh Onclick=editresource (); Preview.focus ();> Edit source code </BUTTON>
<button class= "function" Onclick=seepreview (); Preview.focus ();> results Preview </BUTTON>
<br>
<textarea id=preview style= "Overflow:auto; width:100%; height:150px; </TEXTAREA>

<input type= "Submit" value= "Submission" name= "B1" >&nbsp;

<input type= "Reset" value= "all Override" Name= "B2" >
</form>

<br>

<script language= "JavaScript" >
var doc;
Doc=document.frames.editor.document;
Doc.designmode = "on";
Window.settimeout (' Editor.focus () ', 100);
</script>
</body>

Rich Text Editor Code

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.