title: Removing all values but the first from a drop down list using jQuery
body: <pre><code>             if (questions[0]) {
                   $("select[id$=ddlPollQuestions] &gt; option").remove();
                   $('#ddlPollQuestions').append('&lt;option value=""&gt;Choose a question to compare to&lt;/option&gt;');
                   $.each(questions, function(i, question) {
                       $('#ddlPollQuestions').append('&lt;option value="' + question.QUESTIONID + '"&gt;' + question.TEXT + '&lt;/option&gt;');
                   });
               } else {
                   $("select[id$=ddlPollQuestions] &gt; option").remove();
                   $('#ddlPollQuestions').append('&lt;option value="' + 0 + '"&gt;' + 'There are no questions of this type' + '&lt;/option&gt;');
               }
  </code></pre>
  
  <p>What this does is it removes all the previous values, But i want my first option, which is "Choose a question ..." to remain, and then display "There are not questions..." as my 2nd option. My code here does not show "Choose a question.." as the first option. Thanks for having a look!</p>