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: 
If you want to use jQuery, then do it like this 

```
$("select.fruits").val("Grapes");

```

Javascript 

```
var element = document.getElementsByClassName('fruits')[0];
element.value = valueToSelect;

```
For your HTML Dropdown

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

```

> 
> Using JS You can use **below code** to get desired result
> 
> 
> 

```
document.getElementsByClassName("fruits")[0].selectedIndex = 2 // will select Grapes

```

> 
> Just assign index 0,1..to length of dropdown to get selected value
> 
> 
>