-1

How to make options in select HTML as a main viewer.

My mean is, if this code

<select>
    <option>one</option>
    <option>two</option>
    <option>three</option>
    <option>four</option>
    <option>five</option>
</select>

Run, it will show one when user didn't click that select button yet, but how can I make four as a main without changing the place of that arrangement..

I hope you all understand what I mean..

0

3 Answers 3

6

Try this :

<select>
    <option>one</option>
    <option>two</option>
    <option>three</option>
    <option selected="selected">four</option>
    <option>five</option>
</select>
0

try this if you want to show four as selected

<select>
    <option>one</option>
    <option>two</option>
    <option>three</option>
    <option selected="selected">four</option>
    <option>five</option>
</select>

or

<select>
    <option>one</option>
    <option>two</option>
    <option>three</option>
    <option selected>four</option>
    <option>five</option>
</select>
0

simply use selected attribute which you want to select and others leave as it is.

<option selected="selected">four</option>

Not the answer you're looking for? Browse other questions tagged or ask your own question.