How do I force a scrollbar in a <select> to go to the top of the list?
I have this HTML:
<select multiple='multiple' size='3'>
<option>1</option>
<option&开发者_开发问答gt;2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>
Using jQuery how do I force the scrollbar in the select to go to the top?
$("select").scrollTop(0)
Should work, and, depending upon your browser, might work. But I would not count on it. It does not work in Safari 4, but does work in Firefox 3.5.9
精彩评论