title: JavaScript runtime error: query function not defined for Select2 undefined
body: <pre><code>&lt;select data-bind="select2: {}"&gt;&lt;/select&gt;
  &lt;input data-bind="select2: {}"&gt;
  </code></pre>
  
  <p>if i use HTML <strong>INPUT</strong> with select2 and knockout within <strong>foreach</strong> binding with asp.net mvc i get this error in internet exploler</p>
  
  <pre><code>Unhandled exception at line 2890, column 21 in http://localhost:4052/Scripts/knockout-3.2.0.debug.js
  
  0x800a139e - JavaScript runtime error: query function not defined for Select2 undefined
  </code></pre>
  
  <p>i get no error in mozilla and chrome, but they too dont behave as expected when i do this</p>
  
  <pre><code>&lt;input data-bind="select2: {allowClear: true,placeholder: ' write tags here...', multiple: true, tokenSeparators: [',']}"&gt;
  </code></pre>
  
  <p>when i use <code>&lt;select data-bind="select2: {}"&gt;&lt;/select&gt;</code> i get no error even in IE...
  basically, i want to have a tag input within the knockout auto-generated table that can do tagging like this...</p>
  
  <pre><code>$("#tags1,#tags2").select2({
      allowClear: true,
      placeholder: "Write Tags Here...",
      //createSearchChoice:function(term, data) {return {id:term, text:term};},
      //createSearchChoice:function(term, data) { if ($(data).filter(function() { return this.text.localeCompare(term)===0; }).length===0) {return {id:term, text:term};} },
      multiple: true,
      tags: [],
      tokenSeparators: [","]
      //maximumInputLength: 15,
      //maximumSelectionSize: 5
      //data: [{id: 0, text: 'story', locked: true},{id: 1, text: 'bug'},{id: 2, text: 'task'}]
  });
  </code></pre>
  
  <p>i have used this custom bindings...
  <a href="https://github.com/select2/select2/wiki/Knockout.js-Integration" rel="nofollow">https://github.com/select2/select2/wiki/Knockout.js-Integration</a></p>