<script language="javascript" type="text/javascript">
$(document).ready(function () {
$("select").attr("title", function () {
return $(this).find("option:selected").text();
});
$("select").change(function () {
$(this).attr("title", function () {
return $(this).find("option:selected").text();
});
});
$("select").each(function () {
var i = 0;
var s = this;
for (i = 0; i < s.length; i++) {
s.options[i].title = s.options[i].text;
// the following code is not working in IE so added saperate methods above
/* if (s.selectedIndex > -1) {
s.onmousemove = function () {
s.title = s.options[s.selectedIndex].text;
};
}*/
}
});
});
</script>
No comments:
Post a Comment