title: Create javascript script tag and bind to knockoutjs
body: <p>I am trying to generate knockout templates dynamically and then binding them. As a poc I wrote the following.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
      &lt;title&gt;&lt;/title&gt;
      &lt;script src="Scripts/jquery-2.1.0.js"&gt;&lt;/script&gt;
      &lt;script src="Scripts/knockout-3.1.0.debug.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;button onclick="start()"&gt;Start&lt;/button&gt;
      &lt;button onclick="bind()"&gt;Bind&lt;/button&gt;
  &lt;/body&gt;
  &lt;script&gt;
      function start() {
          var script = document.createElement('script');
          script.id = "summary";
          script.setAttribute('type', 'text/html');
  
          var div = document.createElement('div');
          div.setAttribute('data-bind', 'text: title');
  
          script.appendChild(div);
  
          document.body.appendChild(script);
      }
  
      var viewModel = {
          articles: [{
              id: 1,
              title: "Article One",
              content: "Content for article one."
          },
          {
              id: 2,
              title: "Article Two",
              content: "Content for article two."
          },
          {
              id: 3,
              title: "Article Three",
              content: "Content for article three."
          }
          ]
      };
  
      function bind() {
          ko.applyBindings(viewModel);
      }
  &lt;/script&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Can anyone shed any light on why the code does not display the bound template?</p>
  
  <p>Thanks
  Mike</p>