1

最近我在 Windows 7 机器上升级到 IE11(版本 11.0.9600.16428),<select>当您悬停选择框时,我发现给定的“标题”值根本没有显示。这个问题甚至在带有 IE11 的 Windows 8.1 上也类似。

代码:

<select title="CountryList">
    <option value="">All</option>
    <option value="A">CountryA</option>
    <option value="B">CountryB</option> 
    <option value="0">Not applicable</option>
</select>
4

1 回答 1

3

You're absolutely correct that the behavior changed between Internet Explorer 10, and Internet Explorer 11. In Internet Explorer 10, the title attribute would be revealed as a tooltip when the control was hovered. In Internet Explorer 11 you must have the select menu opened (or using the multiple attribute) in order for the tooltip to appear on hover.

The documentation on MSDN seems to suggest the behavior seen in Internet Explorer 10 is to be expected: "Windows Internet Explorer renders the title as a ToolTip when the user hovers the mouse [or finger] over the object."

This appears to be an issue with Internet Explorer 11. In related news, it used to be the case that Internet Explorer would intentionally not show the title attribute text for select elements. Perhaps this is some type of unintentional regression.

Internet Explorer 11 will show the tooltip when the document is in IE8 mode. You can test this by manually setting the document mode in via your F12 Developer Tools, or by setting the document mode via a meta tag, or HTTP response header:

<meta http-equiv="x-ua-compatible" content="IE=8">

This is not meant to be seen as a solution; it will cause more problems than it solves if your focus is to develop modern solutions, utilizing modern features of the browser.

于 2013-11-16T23:40:09.083 回答