html text editor code example
Example 1: start html
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
</body>
</html>
Example 2: what should i use for html
You can both use notepad(Pc), TextEdit(Mac) but thats not really good
so i would probably use atom, sublime text or visual studio code
Example 3: how to make a text editor in html
function chooseColor(){
var mycolor = document.getElementById("myColor").value;
document.execCommand('foreColor', false, mycolor);
}
function changeFont(){
var myFont = document.getElementById("input-font").value;
document.execCommand('fontName', false, myFont);
}
function changeSize(){
var mysize = document.getElementById("fontSize").value;
document.execCommand('fontSize', false, mysize);
}
function checkDiv(){
var editorText = document.getElementById("editor1").innerHTML;
if(editorText === ''){
document.getElementById("editor1").style.border = '5px solid red';
}
}
function removeBorder(){
document.getElementById("editor1").style.border = '1px solid transparent';
}
Example 4: online html editor
<!-- Answer to: "online html editor" -->
<!--
A common good "online editor" would be:
https://jsfiddle.net/
However, for an online editor focusing specifically on html
this one is pretty good:
https://html-online.com/editor/
-->
Example 5: html online editor
<!-- Good HTML Online Editors -->
<!-- Links -->
https://repl.it
https://codeply.com
https://jsfiddle.net
https://codepen.io
Example 6: text editor in html form
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Edit Article</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<script type="text/javascript" src="ckeditor.js"></script>
</head>
<body>
<h1>Edit Article</h1>
<form action="form_handler.php" method="post">
<div>
<textarea cols="80" rows="10" id="content" name="content">
<h1>Article Title</h1>
<p>Here's some sample text</p>
</textarea>
<script type="text/javascript">
CKEDITOR.replace( 'articleContent' );
</script>
<input type="submit" value="Submit"/>
</div>
</form>
</body>
</html>