How can I show a tooltip for each option on a dropdown with JavaScript or Ajax? - Stack Overflow

admin2025-04-19  0

How can I show a tooltip for each option on a dropdown with JavaScript or Ajax?

It is easy to show with the code behind, but this tooltip is not as fast as a tooltip created with JavaScript.

How can I show a tooltip for each option on a dropdown with JavaScript or Ajax?

It is easy to show with the code behind, but this tooltip is not as fast as a tooltip created with JavaScript.

Share Improve this question edited Jan 8, 2013 at 5:58 Michael Petrotta 61k27 gold badges152 silver badges181 bronze badges asked Jan 8, 2013 at 5:46 Rajeev MehtaRajeev Mehta 51 gold badge1 silver badge2 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 1

You can do something like this with help of javascript by adding this from code behind:

DropDown1.Attributes.Add("onmouseover", 
                         "this.title=this.options[this.selectedIndex].title");

OR

<select name="DropDownList1" id="DropDownList1"
     onmouseover="this.title=this.options[this.selectedIndex].title">
    <option value="1" title="asd">asd</option>
    <option value="2" title="zxc">zxc</option>
    <option value="3" title="qwe">qwe</option>
</select>
use this  : 
<select name="ddlCity" id="ddlCity"
     onmouseover="this.title=this.options[this.selectedIndex].title">
    <option value="Delhi" title="Delhi">Delhi</option>
    <option value="mumbai" title="mumbai">mumbai</option>
    <option value="Chennai" title="Chennai">Chennai</option>
    <option value="kolkata" title="mumbai">mumbai</option>
</select>
转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1745077347a283645.html

最新回复(0)