When I click the screen in div A focus moves to the text box.
When I click Stay A focus moves to that button.
QUESTION: When I move to div B, I need to disable the body focus. When I move back to div A, need to reset it.
<script type=”text/javascript”>
function gotoDivA()
{
document.getElementById(‘A’).style.display = ‘block’;
document.getElementById(‘B’).style.display = ‘none’;
}
function gotoDivB()
{
document.getElementById(‘B’).style.display = ‘block’;
document.getElementById(‘A’).style.display = ‘none’;
}
</script>
<body onfocus=”document.getElementById(‘enterhere’).focus();”>
<div id=”A”>
You are in A
<br><br>
<input type=”button” value=”To B” onClick=”gotoDivB()”>
<br><br>
<input type=”button” value=”Stay A” onClick=”gotoDivA()”>
<br><br>
<input type=”text” id=”enterhere” size=10>
</div>
<div id=”B” style=”display:none”>
You are in B
<br><br>
<input type=”button” value=”To A” onClick=”gotoDivA()”>
</div>