/*
create a function To showOrHideAllDropDowns which takes the newState as a parameter i.e hidden or visible.
*/
function showOrHideAllDropDowns(newState)
{
//getting the elements by the tag select for drop downs or combo box
var elements = document.documentElement.getElementsByTagName('select');
//setting its visibility to new state
for (var i=0; i
elements[i].style.visibility = newState;
} }
|
To use the Above function in a div we can write it like //A small example to call the above function < style="width:220px;" onmouseover="showOrHideAllDropDowns('hidden');" onmouseout="showOrHideAllDropDowns('visible');">
|
Hope you enjoyed the article and will enjoy its working too.