<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Adenola Adefemi</title>
    <description>The latest articles on DEV Community by Adenola Adefemi (@adenolaadefemitech).</description>
    <link>https://dev.to/adenolaadefemitech</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4105944%2F57443d1b-e4c2-430a-9465-8aeaee54e42b.png</url>
      <title>DEV Community: Adenola Adefemi</title>
      <link>https://dev.to/adenolaadefemitech</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/adenolaadefemitech"/>
    <language>en</language>
    <item>
      <title>How I built a live code editor</title>
      <dc:creator>Adenola Adefemi</dc:creator>
      <pubDate>Fri, 04 Sep 2026 16:12:06 +0000</pubDate>
      <link>https://dev.to/adenolaadefemitech/how-i-built-a-live-code-editor-40gg</link>
      <guid>https://dev.to/adenolaadefemitech/how-i-built-a-live-code-editor-40gg</guid>
      <description>&lt;p&gt;Editor From Scratch (With Raw JS) 🚀Tags: #webdev #javascript #beginners #showdevThe Motivation 💡Hey DEV Community! I wanted to share my latest personal project. As I’ve been working on my skills and building my web footprint (including a personal project tracking my love for birds!), I realized I wanted a fast, lightweight sandbox to test code snippets directly in my browser.Instead of jumping into a massive framework, I challenged myself to build a live web-based code editor using nothing but raw, vanilla HTML, CSS, and JavaScript.Here is how I built it and the full source code so you can build your own!🛠️ How It WorksThe architecture is simple but powerful. It splits the screen into two main sections:The Input Pane: A  where you type your code.The Output Pane: An &amp;lt;iframe&amp;gt; that acts as an isolated sandbox environment.The magic happens in the JavaScript. I added an input event listener to the textarea. Every single time a key is pressed, JavaScript grabs the string value and uses .write() to dynamically inject it straight into the iframe's document layout.📄 The Source Code1. index.htmlhtml&amp;lt;!DOCTYPE html&amp;gt;&amp;lt;br&amp;gt;
&amp;lt;html lang="en"&amp;gt;&amp;lt;br&amp;gt;
&amp;lt;head&amp;gt;&amp;lt;br&amp;gt;
    &amp;lt;meta charset="UTF-8"&amp;gt;&amp;lt;br&amp;gt;
    &amp;lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&amp;gt;&amp;lt;br&amp;gt;
    &amp;lt;title&amp;gt;Live Code Editor&amp;lt;/title&amp;gt;&amp;lt;br&amp;gt;
    &amp;lt;link rel="stylesheet" href="style.css"&amp;gt;&amp;lt;br&amp;gt;
&amp;lt;/head&amp;gt;&amp;lt;br&amp;gt;
&amp;lt;body&amp;gt;&amp;lt;br&amp;gt;
    &amp;lt;header class="editor-header"&amp;gt;&amp;lt;br&amp;gt;
        &amp;lt;h1&amp;gt;🐦 Adenola Tech Editor&amp;lt;/h1&amp;gt;&amp;lt;br&amp;gt;
        &amp;lt;p&amp;gt;Type your HTML/CSS code below to see it live&amp;lt;/p&amp;gt;&amp;lt;br&amp;gt;
    &amp;lt;/header&amp;gt;&amp;lt;br&amp;gt;
    &amp;lt;div class="editor-container"&amp;gt;&amp;lt;br&amp;gt;
        &amp;lt;div class="pane input-pane"&amp;gt;&amp;lt;br&amp;gt;
            &amp;lt;div class="pane-title"&amp;gt;Source Code Input&amp;lt;/div&amp;gt;&amp;lt;br&amp;gt;
            &amp;lt;textarea id="code-input" placeholder="Type HTML here..." spellcheck="false"&amp;gt;&amp;lt;h1&amp;gt;Hello World!&amp;lt;/h1&amp;gt;&amp;lt;br&amp;gt;
&amp;lt;p&amp;gt;Welcome to my live editor project.&amp;lt;/p&amp;gt;&lt;br&gt;
        &lt;br&gt;
        &lt;/p&gt;
&lt;br&gt;
            Live Preview Window&lt;br&gt;
            &lt;br&gt;
        &lt;br&gt;
    &lt;br&gt;
    &lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Use code with caution.2. style.csscss* { box-sizing: border-box; margin: 0; padding: 0; }&lt;br&gt;
body { font-family: sans-serif; background: #1e1e1e; color: #fff; height: 100vh; display: flex; flex-direction: column; overflow: hidden; }&lt;br&gt;
.editor-header { background: #2d2d2d; padding: 10px 20px; border-bottom: 2px solid #3c3c3c; }&lt;br&gt;
.editor-header h1 { font-size: 1.2rem; color: #4caf50; }&lt;br&gt;
.editor-container { display: flex; flex: 1; height: calc(100vh - 60px); }&lt;br&gt;
.pane { flex: 1; display: flex; flex-direction: column; }&lt;br&gt;
.input-pane { border-right: 2px solid #3c3c3c; }&lt;br&gt;
.pane-title { background: #252526; padding: 8px 15px; font-size: 0.85rem; font-weight: bold; color: #00bcd4; }

&lt;h1&gt;
  
  
  code-input { flex: 1; background: #1e1e1e; color: #d4d4d4; font-family: monospace; font-size: 1rem; padding: 15px; border: none; resize: none; outline: none; }
&lt;/h1&gt;

&lt;h1&gt;
  
  
  live-preview { flex: 1; background: #fff; border: none; }
&lt;/h1&gt;

&lt;p&gt;Use code with caution.3. script.jsjavascriptconst codeInput = document.getElementById('code-input');&lt;br&gt;
const livePreview = document.getElementById('live-preview');&lt;/p&gt;

&lt;p&gt;function updatePreview() {&lt;br&gt;
    const code = codeInput.value;&lt;br&gt;
    const previewDocument = livePreview.contentDocument || livePreview.contentWindow.document;&lt;br&gt;
    previewDocument.open();&lt;br&gt;
    previewDocument.write(code);&lt;br&gt;
    previewDocument.close();&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;codeInput.addEventListener('input', updatePreview);&lt;br&gt;
window.addEventListener('DOMContentLoaded', updatePreview);&lt;br&gt;
Use code with caution.📈 What's Next?This is just the baseline version! Moving forward, I want to add:Separate workspace tabs for HTML, CSS, and JS files.A download feature to export files directly to your local computer.I'd love your feedback! How would you handle syntax highlighting without relying on massive external libraries? Let me know in the comments below! 👇💡 &lt;/p&gt;

</description>
      <category>webdev</category>
      <category>tutorial</category>
      <category>javascript</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
