A simple editor that contains live preview. You can find the demo here.
-
-
Save molarmanful/3e16d58abc1a4df47100 to your computer and use it in GitHub Desktop.
HTML editor with live preview - 140byt.es
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a.oninput = function(){ //attach keyup event handler to textarea | |
b //equivalent to document.getElementById('b') | |
.innerHTML = a.value //update live preview to match textarea code | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a.oninput=function(){b.innerHTML=a.value} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DO WHAT YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2015 Benjamin Pang <molarmanful.com> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT YOU WANT TO PUBLIC LICENSE | |
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION | |
0. You just DO WHAT YOU WANT TO. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "HTMLEditor", | |
"description": "A simple editor with live preview.", | |
"keywords": [ | |
"editor", | |
"html" | |
] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<title>HTML Editor</title> | |
HTML: | |
<br> | |
<textarea rows="12" cols="100" style="font-family:monospace" id="a"></textarea> | |
<br> | |
<br> | |
Output: | |
<hr> | |
<div height="100%" width="100%" id="b"></div> | |
<script> | |
a.oninput=function(){b.innerHTML=a.value} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As your friendly caddy, let me save you another 3 bytes: