RadiantHex
RadiantHex

Reputation: 25567

How to make a select field show list of options? - Javascript/jQuery

I'm trying to mimic focus on a select field.

e.g. When a user gains focus on a select field, the select field shows the options in a drop down list.

When using $('select').focus(), the options are not shown.


Any help on this one guys? =)

Upvotes: 1

Views: 902

Answers (1)

Robusto
Robusto

Reputation: 31883

Set the size attribute of the select to 6 (or whatever small int you like) on focus and back to 0 on blur.

Upvotes: 4

Related Questions