1

is there a way to show additional information when you point with your cursor on option tag?

<select> <option>Name...</option> </select>

For example some small info-bar near cursor where would be written help info. Thanks

Flixon
  • 25
  • 3
  • 1
    Does this help? [https://stackoverflow.com/questions/3249591/how-can-i-display-a-tooltip-on-an-html-option-tag](https://stackoverflow.com/questions/3249591/how-can-i-display-a-tooltip-on-an-html-option-tag) – Rob Moll Apr 30 '20 at 17:39

2 Answers2

2

Possible solution is the title attribute.

In the below example, when you focus the select input and hover over an option, the title is shown.

<select>
  <option title="more information 1..." value="1">Option 1</option>
  <option title="more information 2..." value="2">Option 2</option>
  <option title="more information 3..." value="3">Option 3</option>
  <option title="more information 4..." value="4">Option 4</option>
 </select>
krummens
  • 837
  • 2
  • 17
  • 38
2

Add the title attribute to the option.

FYI: the title attribute is a Global attribute - - it can be used on just about any visible element to cause a tooltip to appear when that element is hovered over. It also provides some additional accessibility to the element.

<select>
  <option title="Hello">Hello</option>
  <option title="Goodbye">Goodbye</option>  
</select>
Scott Marcus
  • 64,069
  • 6
  • 49
  • 71