Could you please check https://jsfiddle.net/s7fxy8jp/8/
Is there any solution to identify tag range so that when I click on "Set Focus To Element Z" from the fiddle, the cursor will appear just after the end of all tag.
HTML
<div tabindex="-1" id="scripted"><a>Element A (script-only focusable)</a><a>Element B (script-only focusable)</a></div><div id="test">Set Focus To Element Z</div>
CSS
div:focus {
background-color: Aqua;}
JS
document.getElementById('test').onclick = function () {
document.getElementById('scripted').focus();};