title: HTML converter in javascript problems
body: <p>I am currently writing a text to HTML converter that's supposed to:</p>
  
  <p>Get input from text box 1. </p>
  
  <p>Split that input into the elements of an array by paragraph. (I define the paragraph by anything that has text and ends with <code>/n</code>)</p>
  
  <p>Iterate through the array and add <code>&lt;p style=\"font-size: 13px; text-indent: 15px;\"&gt;</code> to the front of every element and <code>&lt;/p&gt;</code> to the end.</p>
  
  <p>Get input from text box 2. (supposed to be single line)</p>
  
  <p>add <code>&lt;p style=\"font-size: 11px; color: #666666; text-align: left; margin-top: 30px;\"&gt;A Power News :&gt;</code> in front and <code>&lt;/p&gt;</code> to the end.</p>
  
  <p>Output both of the into a text box.</p>
  
  <p>The code I have written is as follows:</p>
  
  <p><em>HTML:</em></p>
  
  <pre><code>&lt;form name="input" method="get"&gt;
  Input the text here:&lt;textarea cols="40" rows="5" name="bodyText" id = "bodyText" &gt; &lt;/textarea&gt;&lt;br /&gt;
  Input Author Name:&lt;input type="text" name="authorName" id = "authorName" /&gt;
  &lt;button type="button"value="Convert" onclick="convertBlog()"&gt;Click to convert to html template&lt;/button&gt;
  &lt;/form&gt;
  &lt;textarea cols="110" rows="40" name="output" id= "output"&gt;  &lt;/textarea&gt;
  </code></pre>
  
  <p><em>JavaScript:</em></p>
  
  <pre><code>//STATIC VARIABLES USED FOR THE START AND END OF THE HTML LINES
  var blogParagraphStart = "&lt;p style=\"font-size: 13px; text-indent: 15px;\"&gt;";
  var authorParagraphStart = "&lt;p style=\"font-size: 11px; color: #666666; text-align: left; margin-top: 30px;\"&gt;A Power News 記者: "
  var paragraphEnd = "&lt;/p&gt;"
  
  //GET THE INPUT FROM THE USER AND ASSIGN THEM TO VARIABLES
  var bodyTxt = document.forms["input"]["bodyText"].value;
  var authorName = document.forms["input"]["authorName"].value;
  
  var bodyArray=str.split("\n"); 
  
  
  var end = bodyArray.length+1;
  
  while (i&lt;end){
  bodyArray[i] = blogParagraphStart + bodyArray[i] + paragraphEnd;
  i++;
  }
  
  var reporterOutputString = authorParagraphStart + authorName +paragraphEnd ;
  
  var outputString = bodyArray+ reporterOutputString;
  
  document.getElementById("output").innerHTML= outputString ;
  </code></pre>
  
  <p>For some reason this doesn't work the button does nothing and I haven't been able to figure this out. </p>
  
  <p>I hope I clearly explained my situation. This converter is only for a very specific use so re-usability is not a concern.</p>