title: Unable to get value of the property '2' : object is null or undefined
body: <p>I encounter some problem when I am trying to copy (non-duplicated) selected content from one listbox to another. I keep getting "Unable to get value of the property : object is null or undefined" exception.</p>
  
  <p>Below are my codes</p>
  
  <pre><code>function CopyItem(from, to) {
      var src = document.getElementById(from);
      var dest = document.getElementById(to);
  
      for (var i = 0; i &lt; src.options.length; i++) {
          if (src.options[i].selected) {
              var found = false;
  
              for (var j = 0; j &lt; dest.options.length; j++) {
                  if (dest.options[j].value == src.option[i].value) {
                      found = true;
                      break;
                  }
              }
  
              if (!found) {
                  var newOption = document.createElement("option");
                  newOption.text = src.options[i].text;
                  newOption.value = src.options[i].value;
                  dest.options[dest.options.length] = newOption;
              }
          }
      }
  }
  
  @Html.ListBox("lvDataList", Model.DataList, new { id = "SelectionList", Multiple = "multiple", Size = 15, style = "width: 100%;" })
  @Html.ListBoxFor(x =&gt; x.SelectedData, Model.SelectedDataList, new { id = "SelectedList", Multiple = "multiple", Size = 15, style = "width: 100%;" })
  &lt;input type="button" id="btnAdd" title="Add Selected Events" onclick="CopyItem('SelectionList', 'SelectedList', true)" /&gt;
  </code></pre>
  
  <p>Can someone please explain where did I code wrongly?
  Thanks.</p>