1 function chooseColor(){
2 var mycolor = document.getElementById("myColor").value;
3 document.execCommand('foreColor', false, mycolor);
4 }
5
6 function changeFont(){
7 var myFont = document.getElementById("input-font").value;
8 document.execCommand('fontName', false, myFont);
9 }
10
11 function changeSize(){
12 var mysize = document.getElementById("fontSize").value;
13 document.execCommand('fontSize', false, mysize);
14 }
15
16 function checkDiv(){
17 var editorText = document.getElementById("editor1").innerHTML;
18 if(editorText === ''){
19 document.getElementById("editor1").style.border = '5px solid red';
20 }
21 }
22
23 function removeBorder(){
24 document.getElementById("editor1").style.border = '1px solid transparent';
25 }
26
1
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml">
4<head>
5 <title>Edit Article</title>
6 <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
7 <script type="text/javascript" src="ckeditor.js"></script>
8</head>
9<body>
10 <h1>Edit Article</h1>
11 <form action="form_handler.php" method="post">
12 <div>
13 <textarea cols="80" rows="10" id="content" name="content">
14 <h1>Article Title</h1>
15 <p>Here's some sample text</p>
16 </textarea>
17 <script type="text/javascript">
18 CKEDITOR.replace( 'articleContent' );
19 </script>
20 <input type="submit" value="Submit"/>
21 </div>
22 </form>
23</body>
24</html>
25