вот так без дополнительного клика
<div id="div" style="position: fixed; top: 10px; left: 5px; z-index: 100">
<a href="#" onclick="return false">open</a>
<div style="display: none">
<input><br>
<input>
</div>
</div>
<div></div>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<input onclick="alert('input')">
<script>
window.onload = function () {
var div = document.getElementById('div');
div.onclick = function (e) {
e = e || event;
var target = e.target || e.srcElement;
if (target == this.children[0]) {
var next = target.nextSibling.nextSibling;
if (next.style.display != 'block') {
next.style.display = 'block';
target.innerHTML = 'close';
div.nextSibling.nextSibling.style.cssText = 'position: fixed; left: 0px; top: 0px; height: 100%; width: 100%; z-index: 99';
} else {
next.style.display = 'none';
target.innerHTML = 'open';
div.nextSibling.nextSibling.style.cssText = '';
}
}
}
div.nextSibling.nextSibling.onclick = function (e) {
e = e || event;
div.children[1].style.display = 'none';
div.children[0].innerHTML = 'open';
this.style.cssText = '';
var elem = document.elementFromPoint(e.clientX, e.clientY);
elem.focus();
elem.click();
}
}
</script>