<select>
<option>aaaaa</option>
<option>bbbbb</option>
<option>ccccc</option>
</select>
<button>button</button>
<script>
$.fn.openSelect = function() {
return this.each(function(idx,domEl) {
if (document.createEvent) {
var event = document.createEvent("MouseEvents");
event.initMouseEvent("mousedown", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
domEl.dispatchEvent(event);
} else if (element.fireEvent) {
domEl.fireEvent("onmousedown");
}
});
}
$('button').on('click', function() {
$('select').openSelect();
});
</script>
该处用到了XML的【XML】document.createEvent的使用方法