My problem occurs in IE10 and Firefox, but works in Chrome.
I have an anchor like this:
<a id="link-to-form" href="#bonus-form">
An also I have an input element that I have it focused using jquery:
<input type="text" id="firstname" name="firstname" required />
$(document).ready(function(){
$('#firstname').focus();
});
My problem is that when I press the anchor link, and it moves inside the page, the focus is lost from my input tag. I would like to keep the focus on my input, after I press the anchor link.
I have tried many things, last one was the following. But still it doesn't focus. Actually the click event is fired on the debugger, but immediately the anchor executes and it loses focus again:
$("#link-to-form").on("click", function (e) {
$('#firstname').focus();
return true;
});