iamvdo / Reveal-liveCoding

Live coding in Reveal.js
17 stars 6 forks source link

Fix HTML input #4

Closed sbehrends closed 7 years ago

sbehrends commented 7 years ago

innerHTML was bringing encoded entities, textContent works better :)

This way I got working HTML and CSS on same div 👍

<div id="demo-2"></div>
<pre>
<code class="liveCoding language-html" data-livecoding-id="demo-2" contenteditable><p>I'm a text</p>
</code>
</pre>

<pre>
<code class="liveCoding language-css" data-livecoding-id="demo-2" contenteditable>.p {
  color: red;
}
</code>
</pre>