🌱 planting ideas 🌱

focus inside iframe from skip to main content

1
<div class="skipnav"><a tabindex="1" href="#groupFrame">Skip to main content</a></div>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
jQuery(document).ready(function() {
jQuery('a[href="#groupFrame"]').click(function(e) {
e.preventDefault();
setTimeout(setFocusIframe, 100);
return false;
});

function setFocusIframe() {
console.log("Focusing on iframe!!");
jQuery("#groupFrame")[0].contentWindow.focus();
// jQuery("html, body").animate({ scrollTop: "0px" }, 1000, function(){
// jQuery('input#Name_First').focus();
// });
}
});