Monday 11 March 2013

Display DropDownList Item on Mouse Hover Using Javascript

Display DropDownList Item on Mouse Hover Using Javascript

You can display the contents of the dropdownlists on hovering the Mouse Over the dropdown using the following Javascript Code..

<html xmlns="">
<head runat="server">

<title>Dropdownlist Hover</title>
<script type="text/javascript">

function Open_ddl(ddl) {

document.getElementById(ddl).size = 5


function Close_ddl(ddl) {

document.getElementById(ddl).size = 1




<form id="form1" runat="server">


<asp:DropDownList ID="DropDownList1" runat="server" onmouseover="Open_ddl('DropDownList1')"











  1. document.getElementById('ddl').size = 5

    ddl should be in single quotes...

  2. No It will be not.. However If you want you can keep 'DropDownList1' in single quotes in the document.getElementById .. But since we are assigning the value of ddl in dropdownlist tag itself:

    So we dont need to specify it again.. So the value of ddl in the function Open_ddl and Close_ddl will be DropDownList1 .. It will not hamper the performance..

    For More Details, You can check the following link:

    In case of any doubts you can test the application to see if this working or not.

    Thank You.


Thank You for Your Comments. We will get back to you soon.

back to top