How to add a tooltip to a <option> in a <select> box in HTML?
In firefox stable (v38) and earlier versions of chrome, I have used the "title" HTML attribute on nodes so that the user can hover over a given option and view a tooltip or "hover text". Here's an example of what I am referring to:
<select>
<option title="hover text!">Thing 1</option>
<option title="hover text!">Thing 5</option>
<option title="hover text!">Thing 3</option>
<option title="hover text!">Thing 2</option>
<option title="hover text!">Thing 42</option>
</select>
Here is a jsfiddle of the above code: http://jsfiddle.net/lsabota/bt3x780j/20/
This seems to work with firefox stable (v38), but doesn't work with the latest stable version of Chrome and doesn't seem to work with Firefox Aurora. I would expect a user to be able to hover over any of the options and see the title text (which works in older version of Chrome and the latest version of Firefox). I had always thought that the title HTML attribute was the proper way to do this - is there another way to accomplish this? Is the title attribute getting deprecated for nodes?
I opened a bug on the mozilla bugzilla and this has been resolved in firefox. "Title" is a valid attribute for option and is respected among major browsers
After doing some Google and research I came to know the mentioned latest version of web browser does not work with title attribute. The Title attribute does not deprecated.
链接地址: http://www.djcxy.com/p/49654.html上一篇: 修改IOS网站的CSS