html代碼如下:
<select id="category" name="category"> <option value="">請選擇類別</option> <option value="1">類別1</option> <option value="2">類別2</option> <option value="3">類別3</option> <option value="4">類別4</option> </select>
js代碼:
<script type="text/javascript"> $('#category option[value=3]').attr('selected',true); </script>