title: How to reset a select box after hiding a modal?
body: <p>I have a select box:</p>
  
  <pre><code>&lt;select class="selectpicker" id="select_seleccionar_proyecto_id"&gt;
      &lt;option value="0"&gt;Seleccione..&lt;/option&gt;
      &lt;option value="1"&gt;Tarea número 1&lt;/option&gt;
      &lt;option value="2"&gt;Tarea número 2&lt;/option&gt;
      &lt;option value="3"&gt;Tarea número 3&lt;/option&gt;
      &lt;option value="4"&gt;Tarea número 4&lt;/option&gt;
      &lt;option value="5"&gt;Tarea número 5&lt;/option&gt;
      &lt;option value="6"&gt;Tarea número 6&lt;/option&gt;
  &lt;/select&gt;   
  </code></pre>
  
  <p>The select box is located in a modal, and after I close the modal, the select box remains with last selected option last time.</p>
  
  <p>I built a method that is called after the modal is hidden but nothing I have tried seems to reset the select box: </p>
  
  <pre><code>LimpiarModalTarea: function(){
  
      var self = this;
  
      //My attempts:
      /*
       * $("select option[value='0']").attr("selected","selected");
       * $("select_seleccionar_proyecto_id").val($("select option[value='0']").val());
       * $("#target").val($("#select_seleccionar_proyecto_id option:first").val());
       * $( "#select_seleccionar_proyecto_id option:first" ).val(); 
       */
  },
  </code></pre>
  
  <p>I put an alert in <code>LimpiarModalTarea</code> and when I closed the modal, the alert work.. so I know that the method is called.</p>
  
  <p>Any suggestions?</p>
  
  <p>modal image
  <a href="http://www.uppic.com/uploads/14302560911.jpg" rel="nofollow">http://www.uppic.com/uploads/14302560911.jpg</a></p>
  
  <p>EDIT:</p>
  
  <p>I'm sorry, but I did not mention that work with different modules.</p>
  
  <p>In the module "A" I have the method that contains the button that opens the modal method and published:</p>
  
  <p>This method contains the html:</p>
  
  <pre><code>                    +                       
                      '&lt;a href="#myModal2" role="button" class="btn btn-success btn-sm" id ="btn_seleccionarTarea_'+iContProyecto+'_id" data-toggle="modal"&gt;&lt;strong&gt;Seleccionar una tarea&lt;/strong&gt;&lt;/a&gt;'
                      +   
  </code></pre>
  
  <p>This method contains the publication:</p>
  
  <pre><code>PublicarBotonSeleccionarTarea: function(icontTarea){
  
      var self = this;
  
      $("#btn_seleccionarTarea_"+icontTarea+"_id").click(function(){
      self.publishers("seleccionProyecto_seleccionarTarea", icontTarea);
      });
  },
  </code></pre>
  
  <p>In the module "B " I subscribe with this method :</p>
  
  <pre><code>subscribers : function() {
  
      var self = this;
      self.sb.subscribe('seleccionProyecto_seleccionarTarea', function(data) {
      self.idTarea=data;
      self.showModal();
      });
      },
  </code></pre>
  
  <p>Action buttons in the modal:</p>
  
  <pre><code>CargarAcciones: function(){
  
      var self = this;
      self.hideError();
      $('#btn_modal_seleccionarTarea_cancelar_id').click(function(){
  
      self.HideModal();
      self.hideError();
  
      });  
      $('#btn_modal_seleccionarTarea_aceptar_id').click(function(){
  
      var seleccionTarea = $( "#select_seleccionar_proyecto_id option:selected" ).val();
      if(seleccionTarea!=0){
      self.envioNombreTarea();
      self.HideModal();
      }else{
      self.showError();
  
      }
  
  
      });
      },
  </code></pre>
  
  <p>Then I start to work on what I mentioned before ,so I don´t have the button on the same module.</p>
  
  <p>I need to clean the modal in Module B</p>