I'm trying to press enter (programmatically) on a drop down element. I CANNOT USE JQUERY. The drop down is already in focus, I just want to click enter to open it. Any ideas how it can be achieved? Here's my HTML:
<select class="test">
<option value="1">item1</option>
<option value="2">item2</option>
<option value="3">item3</option>
<option value="4">item4</option>
<option value="5">item5</option>
<option value="6">item6</option>
</select>
And the JS that got the element focused:
document.getElementsByClassName('test')[0].focus();