弹框出现与Tab键索引起始位置变化实例页面
回到相关文章 »代码:
CSS代码:
.wrap_out { outline:none; }
HTML代码:
<div id="zxxBlank"> <div class="wrap_out" id="wrapOut" tabindex="-1"> ... </div> </div>
JS代码:
var eleDialogBtn = document.getElementById('dialogButton'); var eleDialog = document.getElementById('zxxBlank'); var eleWrapOut = document.getElementById('wrapOut'); eleDialogBtn.onclick = function () { // 显示 eleDialog.style.display = 'block'; // 聚焦 eleWrapOut.focus(); };