Question: ```
<select class=fruits">
<option value="Orange">Orange</option>
<option value="Apple">Apple</option>
<option value="Grapes">Grapes</option>
<option value="Kiwi">Kiwi</option>
</select>

```

it by default shows orange in the box but I want Grapes in a box. Please help
Thanks

Answer: 
HTML Code:

```
<select class=fruits">
<option value="Orange">Orange</option>
<option value="Apple">Apple</option>
<option value="Grapes">admin</option>
<option value="Kiwi">Kiwi</option>
</select>

```

javascript:

```
$('.fruits option:eq(2)').attr('selected', 'selected');

```

eq(nth), you can pass index which option you want to select by default. it's start from 0 to n-1.
You can use the selectedIndex property:

```js
$('select.fruits').prop('selectedIndex',  2);
```

```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<select class="fruits">
<option value="Orange">Orange</option>
<option value="Apple">Apple</option>
<option value="Grapes">Grapes</option>
<option value="Kiwi">Kiwi</option>
</select>
```

The code above will select the third option, since the index starts from 0.