반응형
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);
});
반응형
'프로그래밍 > Script' 카테고리의 다른 글
[javascript] jQuery HTML / CSS Methods (0) | 2020.10.21 |
---|---|
[javascript] jQuery - append, prepend, after, before (0) | 2020.10.21 |
[javascript] null, undefined, 공백 체크 (0) | 2020.10.12 |
[CSS] CSS Selector (0) | 2020.09.08 |
TypeScript-Handbook 한글 문서 (0) | 2020.08.28 |