Live HTML Code Editor
See the results instantly. This script grabs the value of a textarea on every keystroke and injects it as `innerHTML` into a preview container.
Copy the Script
<textarea onkeyup="render(this.value)"></textarea>
<div id="preview"></div>
<script>
function render(html) {
document.getElementById("preview").innerHTML = html;
}
</script>
Frequently Asked Questions
For personal use, yes. If you allow *other* users to see what someone else typed (saving to a database), you MUST sanitize the input to prevent XSS attacks (malicious scripts).
Yes. If the user types ``, it will execute. This makes it a powerful tool for testing code snippets.
Yes. Users can type `` and it will apply to the preview area.