I have a selection box like this
<select name="select1" onmousedown="if(this.options.length>5){this.size=5;}"
onchange="this.size=0;" onblur="this.size=0;" style="width:200px">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
<option>11</option>
<option>12</option>
<option>13</option>
<option>14</option>
<option>15</option>
</select>
When you click on an arrow to delete a list, only the first five parameters are displayed in it. Now I want to achieve this - when I scroll down, a number similar to the currently selected option will appear next to the scroll bar (for example, when I scroll to the 6th parameter, this number will show “6” when I scroll to the 10th option it will show "10", etc.). Any ideas on how to do this?
Image for demonstration as below

source
share