title: Remove duplicate value from combobox which is dynamically created
body: <p>I have a combo box, which has got some values, also I have some few values, I select one value from combo box and do some manipulation and come back with the value selected (set these values in session). Now I need to automatically select the value which are in session in the combo box.</p>
  
  <p>I have followed the below JavaScript and it works fine but it creates a duplicate value which is already in the combo box:</p>
  
  <pre><code>function addCombo() {
      var reportID = '&lt;%=reportid%&gt;';
      var reportName = '&lt;%=reportname%&gt;';
  
      var textb = document.getElementById("reportnames");
  
      var option = document.createElement("option");
      option.text = reportName;
      option.value = reportID;
      option.selected='selected';
      try {
          textb.add(option, null); //Standard
      }catch(error) {
          textb.add(option); // IE only
      }
      textb.value = "";
  }
  </code></pre>
  
  <p>Could anyone help me to identify?</p>