Forum Moderators: open

Message Too Old, No Replies

tooltip text

select

         

prasanth

7:17 am on Sep 22, 2005 (gmt 0)

10+ Year Member



Hi all,

can any one knows how to add tooltip text to all options in select.

regards

Dijkgraaf

11:25 pm on Sep 22, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The following works in FireFox. However in IE you will only get the tooltip when the mouse is over the label.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
<script type="text/javascript">
function settooltip(dropdown) {
tooltip.title = dropdown.value;
}
</script>
</head>
<body>
<form name="test">
<span title="select an option" id="tooltip">Select
<select name="selectthis" onchange="settooltip(this);">
<option value=""></option>
<option value="1">a</option>
<option value="2">b</option>
<option value="2">c</option>
</select>
</span>
</form>
</body>
</html>