반응형

 Deleting duplicated values from html form drop-down option list.

HTML 양식 드롭 다운 옵션 목록에서 중복 된 값 삭제

 

<select name="det_pas_object_gatve" class="det_pas_object_select_css">
<option selected="selected" value="">--- Choose street ---</option>
    <option value="Barrow">Barrow</option>
    <option value="Hornets">Hornets</option>
    <option value="Barrow">Barrow</option>
    <option value="Stanley">Stanley</option>
    <option value="Simon">Simon</option>
    <option value="Barrow">Barrow</option>
</select>





var foundedinputs = [];
       $("select[name=det_pas_object_gatve] option").each(function() {
         if($.inArray(this.value, foundedinputs) != -1) $(this).remove();
         foundedinputs.push(this.value);
       });
반응형

+ Recent posts