JSFiddle - React, Tailwind, and code Playground

HTML

<div id="toggle">toggle</div>
<div>foobar</div>
<select id="select" multiple>
	<option>foo</option>
	<option>bar</option>
</select>

JavaScript

document.getElementById('toggle').onclick = function () {
		var select = document.getElementById('select');
		select.style.display = select.style.display === 'none' ? 'inline' : 'none';
		select.focus();
	};
	document.getElementById('select').onblur = function () {
		this.style.display = 'none';
	};