jQuery("#inputCount").get(0).length  ;  // 셀렉트박스 길이

jQuery("#inputCount").get(0).options[0].selected = true; //첫번째 항목이 선택되게

 

 //옵션추가

for(var i=0; i<=count; i++){
   jQuery("#inputCount").get(0).options[i] = new Option(i + "개", i);  }

 

//옵션 초기화

for (var i = jQuery("#"+objName).get(0).length-1; i>=1; i--)
{
     jQuery("#"+objName).get(0).options[i] = null;
}

 

document.getElementById("inputCount").reInitializeSelectBox(102);    //이건 selectbox에 css가 안먹어서 js로 억지로 만들어 끼워 넣었는데 가로 size가 잘 안먹어서 다시 생성해주는 스크립트로 넣었음. 102는 넓이

 

 

<select id="inputCount" name="inputCount">
        <option value="">선택수량</option>
        <option value="1">1개</option>
</select>

+ Recent posts