I've gotten everything in my assignment to work except pretty much the main part. I can't figure out how to make my code read the contents of my textarea as HTML code and display the results in a new window. I can't even figure out how to display the contents as they appear.
I haven't kept an entire log of all the the different forums I have visited, but here are a couple of the last few I was checking out.
Open a new browser window/iframe and create new document from HTML in TEXTAREA?
https://www.codingforums.com/javascript-programming/174810-previewing-textarea-popup.html
<!DOCTYPE html>
<html lang="en">
<head>
<title>
Wiki editor
</title>
</head>
<body>
<h1> Rachel </h1>
<script>
var previewOpen;
function preview() {
previewOpen = window.open("", "previewOpen", "width=500, height=600");
previewOpen.document.body.innerHTML = "HTML"; // Get the value of text area and run HTML code
}
function closePreview() {
previewOpen.close();
// function to close the preview
}
</script>
<p>Type your HTML code below:</p>
<textarea rows="20" cols="75">
</textarea>
<!-- textarea for submittance of code to be read and written -->
<br>
<span><input id="preview" type="submit" value="Preview" onClick="preview()">
<input id="closePreview" type="submit" value="Close Preview" onClick="closePreview()"></span> <!-- buttons with event handlers to read areatext and perform functions-->
</body>
</html>