Tools

Run HTML Code

Run HTML Code

Runs HTML code within the browser.

How does it work?

This website runs code simply by taking the input from the text area and running it with a simple JavaScript event listener using the following code:

const HTML = document.getElementById('html');
const OUTPUT = document.getElementById('outputWindow');
HTML.addEventListener('keypress', () => {
    setTimeout(() => {
        OUTPUT.innerHTML = HTML.value;
    }, 10);
})

Every time the text within the text area changes, it runs it in the output window.