title: JQuery - Perform a "find()" excluding certain elements and their descendants
body: <p><strong>QUESTION:</strong></p>
  
  <p>Perform a "find()" excluding certain elements and their descendants.</p>
  
  <p><strong>REAL CASE:</strong></p>
  
  <p>Code Sample</p>
  
  <p>The purpose of the code below is try to select all elements within <code>$("#lbr_placehld")</code>, but exclude all those that have the attribute <code>lbr_mval_placehld</code> and its descendants.</p>
  
  <pre><code>$("#lbr_placehld").find(":not([lbr_mval_placehld])");
  </code></pre>
  
  <p>HTML sample</p>
  
  <pre><code>&lt;span id="lbr_placehld" lbr_mval_placehld="" lbr_mval_phld_grp_path="mg_bases_n_forms#1"&gt;
    &lt;div class="form-group"&gt;
      &lt;label class="col-xs-2 control-label no-padding-right" for="for_str_nm_base"&gt;Nome da Base&lt;/label&gt;
      &lt;div class="col-xs-10"&gt;
        &lt;div class="clearfix"&gt;
          &lt;input lbr_mval_fld_nm="str_id_base" name="mg_bases_n_forms#1.str_id_base" type="hidden"&gt;
          &lt;input class="col-xs-5" lbr_invalidat_msg="" lbr_mval_fld_fdly_nm="Nome da Base" lbr_mval_fld_nm="str_nm_base" name="mg_bases_n_forms#1.str_nm_base" type="text" autocomplete="off" lbr_fdly_nm="Nome da Base 2"&gt;
          &lt;a href="#" title="Remover este item" class="lbr-tooltip" lbr_mval_op="rmthis" onclick="lbrad_MultivaluedManipulate(this);return false;"&gt;
          &lt;i class="fa fa-remove red field-border-icon"&gt;&lt;/i&gt;
          &lt;/a&gt;
          &lt;div lbr_mval_container="" class="widget-box transparent"&gt;
            &lt;div class="widget-header widget-header-small"&gt;
              &lt;h6 class="smaller"&gt;&lt;/h6&gt;
              &lt;div class="widget-toolbar"&gt;
                &lt;a href="#" title="Remover último item" class="lbr-tooltip" lbr_mval_op="rmlast" onclick="lbrad_MultivaluedManipulate(this);return false;" style="display: inline;"&gt;
                &lt;i class="fa fa-remove red border-icon"&gt;&lt;/i&gt;
                &lt;/a&gt;
                &lt;a href="#" class="lbr-tooltip" lbr_mval_op="add" onclick="lbrad_MultivaluedManipulate(this);return false;" title="Adicionar item"&gt;
                &lt;i class="fa fa-plus blue border-icon"&gt;&lt;/i&gt;
                &lt;/a&gt;
                &lt;a href="#" title="Remover todos itens" class="lbr-tooltip" lbr_mval_op="rmall" onclick="lbrad_MultivaluedManipulate(this);return false;" style="display:none;"&gt;
                &lt;i class="fa fa-remove red border-icon"&gt;&lt;/i&gt;
                &lt;/a&gt;
              &lt;/div&gt;
            &lt;/div&gt;
            &lt;div class="widget-body"&gt;
              &lt;div class="widget-main"&gt;
                &lt;span lbr_mval_grp_path="mg_forms" lbr_mval_last_idx="3"&gt;
                  &lt;div class="form-group"&gt;
                    &lt;label class="col-xs-2 control-label no-padding-right" for="for_str_nm_base"&gt;Nome do Form&lt;/label&gt;
                    &lt;div class="col-xs-10"&gt;
                      &lt;div class="clearfix"&gt;
                        &lt;input lbr_mval_fld_nm="str_id_form" name="mg_bases_n_forms#1.str_id_form" type="hidden"&gt;
                        &lt;input class="col-xs-5" lbr_invalidat_msg="" lbr_mval_fld_fdly_nm="Nome do Form" lbr_mval_fld_nm="str_nm_form" name="mg_bases_n_forms#1.str_nm_form" type="text" autocomplete="off" lbr_fdly_nm="Nome do Form 2"&gt;
                        &lt;a href="#" title="Remover este item" class="lbr-tooltip" lbr_mval_op="rmthis" onclick="lbrad_MultivaluedManipulate(this);return false;"&gt;
                        &lt;i class="fa fa-remove red field-border-icon"&gt;&lt;/i&gt;
                        &lt;/a&gt;
                      &lt;/div&gt;
                    &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;hr&gt;
                &lt;/span&gt;
                &lt;span lbr_mval_placehld="" lbr_mval_phld_grp_path="mg_forms#0"&gt;
                  &lt;div class="form-group"&gt;
                    &lt;label class="col-xs-2 control-label no-padding-right" for="for_str_nm_base"&gt;Nome do Form&lt;/label&gt;
                    &lt;div class="col-xs-10"&gt;
                      &lt;div class="clearfix"&gt;
                        &lt;input lbr_mval_fld_nm="str_id_form" name="mg_forms#0.str_id_form" type="hidden"&gt;
                        &lt;input class="col-xs-5" lbr_invalidat_msg="" lbr_mval_fld_fdly_nm="Nome do Form" lbr_mval_fld_nm="str_nm_form" name="mg_forms#0.str_nm_form" type="text" autocomplete="off" lbr_fdly_nm="Nome do Form 1"&gt;
                        &lt;a href="#" title="Remover este item" class="lbr-tooltip" lbr_mval_op="rmthis" onclick="lbrad_MultivaluedManipulate(this);return false;"&gt;
                        &lt;i class="fa fa-remove red field-border-icon"&gt;&lt;/i&gt;
                        &lt;/a&gt;
                      &lt;/div&gt;
                    &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;hr&gt;
                &lt;/span&gt;
                &lt;span lbr_mval_placehld="" lbr_mval_phld_grp_path="mg_forms#1"&gt;
                  &lt;div class="form-group"&gt;
                    &lt;label class="col-xs-2 control-label no-padding-right" for="for_str_nm_base"&gt;Nome do Form&lt;/label&gt;
                    &lt;div class="col-xs-10"&gt;
                      &lt;div class="clearfix"&gt;
                        &lt;input lbr_mval_fld_nm="str_id_form" name="mg_forms#1.str_id_form" type="hidden"&gt;
                        &lt;input class="col-xs-5" lbr_invalidat_msg="" lbr_mval_fld_fdly_nm="Nome do Form" lbr_mval_fld_nm="str_nm_form" name="mg_forms#1.str_nm_form" type="text" autocomplete="off" lbr_fdly_nm="Nome do Form 2"&gt;
                        &lt;a href="#" title="Remover este item" class="lbr-tooltip" lbr_mval_op="rmthis" onclick="lbrad_MultivaluedManipulate(this);return false;"&gt;
                        &lt;i class="fa fa-remove red field-border-icon"&gt;&lt;/i&gt;
                        &lt;/a&gt;
                      &lt;/div&gt;
                    &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;hr&gt;
                &lt;/span&gt;
                &lt;span lbr_mval_placehld="" lbr_mval_phld_grp_path="mg_forms#2"&gt;
                  &lt;div class="form-group"&gt;
                    &lt;label class="col-xs-2 control-label no-padding-right" for="for_str_nm_base"&gt;Nome do Form&lt;/label&gt;
                    &lt;div class="col-xs-10"&gt;
                      &lt;div class="clearfix"&gt;
                        &lt;input lbr_mval_fld_nm="str_id_form" name="mg_forms#2.str_id_form" type="hidden"&gt;
                        &lt;input class="col-xs-5" lbr_invalidat_msg="" lbr_mval_fld_fdly_nm="Nome do Form" lbr_mval_fld_nm="str_nm_form" name="mg_forms#2.str_nm_form" type="text" autocomplete="off" lbr_fdly_nm="Nome do Form 3"&gt;
                        &lt;a href="#" title="Remover este item" class="lbr-tooltip" lbr_mval_op="rmthis" onclick="lbrad_MultivaluedManipulate(this);return false;"&gt;
                        &lt;i class="fa fa-remove red field-border-icon"&gt;&lt;/i&gt;
                        &lt;/a&gt;
                      &lt;/div&gt;
                    &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;hr&gt;
                &lt;/span&gt;
                &lt;span lbr_mval_placehld="" lbr_mval_phld_grp_path="mg_forms#3"&gt;
                  &lt;div class="form-group"&gt;
                    &lt;label class="col-xs-2 control-label no-padding-right" for="for_str_nm_base"&gt;Nome do Form&lt;/label&gt;
                    &lt;div class="col-xs-10"&gt;
                      &lt;div class="clearfix"&gt;
                        &lt;input lbr_mval_fld_nm="str_id_form" name="mg_forms#3.str_id_form" type="hidden"&gt;
                        &lt;input class="col-xs-5" lbr_invalidat_msg="" lbr_mval_fld_fdly_nm="Nome do Form" lbr_mval_fld_nm="str_nm_form" name="mg_forms#3.str_nm_form" type="text" autocomplete="off" lbr_fdly_nm="Nome do Form 4"&gt;
                        &lt;a href="#" title="Remover este item" class="lbr-tooltip" lbr_mval_op="rmthis" onclick="lbrad_MultivaluedManipulate(this);return false;"&gt;
                        &lt;i class="fa fa-remove red field-border-icon"&gt;&lt;/i&gt;
                        &lt;/a&gt;
                      &lt;/div&gt;
                    &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;hr&gt;
                &lt;/span&gt;
              &lt;/div&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;hr&gt;
  &lt;/span&gt;
  </code></pre>