title: write a HTML form to webpage using javascript function
body: <p>I'm writing a javascript library and I need to make a javascript function which you can call to create a form (scheduler) on your webpage. </p>
  
  <p>this is the html code of the form:</p>
  
  <pre><code>    &lt;form&gt;
      &lt;table border="1" cellpadding="5"&gt;
      &lt;tr&gt;&lt;td id="schedulename" colspan="10"&gt;Time Schedule&lt;/td&gt;&lt;/tr&gt;
      &lt;tr&gt;
          &lt;td width="50"&gt;hours&lt;/td&gt;
          &lt;td&gt;&lt;/td&gt;
          &lt;td width="50"&gt;minutes&lt;/td&gt;
          &lt;td&gt;Mon&lt;/td&gt;
          &lt;td&gt;Tue&lt;/td&gt;
          &lt;td&gt;Wed&lt;/td&gt;
          &lt;td&gt;Thu&lt;/td&gt;
          &lt;td&gt;Fri&lt;/td&gt;
          &lt;td&gt;Sat&lt;/td&gt;
          &lt;td&gt;Sun&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td width="50"&gt;&lt;input type="text" id="hours" maxlength="2" size="1"&gt;&lt;/td&gt; 
          &lt;td width="2"&gt; : &lt;/td&gt; 
          &lt;td width="50"&gt;&lt;input type="text" id="minutes" maxlength="2" size="1"&gt;&lt;/td&gt;
          &lt;td&gt; &lt;input type="checkbox" id="mon"&gt;&lt;/td&gt;
          &lt;td&gt; &lt;input type="checkbox" id="tue"&gt;&lt;/td&gt;
          &lt;td&gt; &lt;input type="checkbox" id="wed"&gt;&lt;/td&gt;
          &lt;td&gt; &lt;input type="checkbox" id="thu"&gt;&lt;/td&gt;
          &lt;td&gt; &lt;input type="checkbox" id="fri"&gt;&lt;/td&gt;
          &lt;td&gt; &lt;input type="checkbox" id="sat"&gt;&lt;/td&gt;
          &lt;td&gt; &lt;input type="checkbox" id="sun"&gt;&lt;/td&gt;
      &lt;/tr&gt;
  
  
      &lt;tr&gt;
          &lt;td colspan="10"&gt; &lt;input type="button" id="setbutton" value="Set schedule"&gt;&lt;/td&gt;
      &lt;/table&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>my idea of the result is that a user only needs to create a div in his webpage, then in the javascript, call my function with the right parameters which in turn shows my predefined form. But I also need to add some functionality to the 'setbutton' it needs to write the data to an adres in my PLC (programmable logic controller)</p>
  
  <p>what I want the function call to look like: showScheduler(id, adres);
  id is the id of the division and adres is the adres in my programmable logic controller I need to write to.</p>
  
  <p>What is the best way to write the form to my webpage from within a javascript function?</p>
  
  <p>I hope u guys can understand but i'll gladly give you more explanation if needed.</p>