So, I have a textarea that users are supposed to type codes into.
Ex: <div id="example">blar</div>
How can I evaluate what they enter in the textarea as HTML (as in the DOM) without:
- jQuery
- Having to create a new element
For example:
Code: <div id="ex">Blar</div>
My Function:
function parseCode(){
var code = document.getElementById("code").value;
}
I want to take the value and make it accessible (like code.getElementsByTagName("div")[0].innerHTML
);