title: jquery: Select items in a listbox and trigger change
body: <p>I can't seem to be able to trigger a change on my listbox after I have changed the selected value in code. Change function works great if the listbox is actually clicked. I have searched the forums and none of the solutions seem to work for me. Example code is below. I have also set up a jsfiddle <a href="http://jsfiddle.net/65wHW/" rel="nofollow">here</a>. I want it to go into the change function when the code is run.</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;form&gt;
    &lt;select class="selectOneListBox" id="CompanyId" multiple="multiple" name="CompanyId"&gt;        
      &lt;option value="1"&gt;Test&lt;/option&gt;
      &lt;option value="2"&gt;Test 2&lt;/option&gt;
      &lt;option value="3"&gt;Test&lt;/option&gt;
    &lt;/select&gt;
  &lt;form&gt;
  </code></pre>
  
  <pre class="lang-js prettyprint-override"><code>$(function () {
    id = 3
    if (id &gt; 0) {
      alert(id)
      $('#CompanyId').val(id).change();
    }
  }); 
  
  $("#CompanyId").change(function () {
    alert("change");
  });
  </code></pre>