I came up with an idea for a javascript thing that lets the user write in a message. Then they can click generate and it will show them code they can copy and paste onto a webpage to use.
I created the javascript program and it works great. Now I want to let the user fill in the form and generate the code. This is where im kinda stuck. I tried making a string var and making it equal the code (I put all the code on one line, got rid of the tags and left only the tags and the html code.
I will add the code to a textarea when it works but it does not seem to want to.
On my page: (generate is called when the user clicks a button)
<script>
function Generate()
{
var generatedCode = "<script> </script> hello";
document.getElementById("codeArea").value = generatedCode;
}
</script>
in the html area:
<textarea rows="6" cols="51" id="codeArea">
currently this shows up on the top of the page:
hello"; document.getElementById("codeArea").value = generatedCode; }