SELECT
drop down menu is opened right after you trigger mousedown
event. To prevent it from opening, you must block the event on mousedown
so that it won't trigger any further event. This is the example:
function test() {
// do something here
return false;
}
with HTML
<select onmousedown="test();"><!-- options here --></select>
OR
function test() {
// do something here
}
with HTML
<select onmousedown="test(); return false;"><!-- options here --></select>
The difference is with the 1st method, you can't call anymore function in the mousedown
event on the SELECT
tag. But you can do it with the 2nd method right before return false;