I have bootstrap form in my website when a user focus on textfield the page don't scroll to view so i found this JQuery code and apply it
$(":input[type='text']").focus(function () {
var e = $(this);
$("html, body").animate({
scrollTop: e.offset().top - 100
}, 400)
it is working but it is also affecting the links in the page
<a href="/login">create your account.</a>
when i click the link it does the scroll to the top of the page if i click it again it goes to the login page. I have to click the link two times to go the login page.
did i miss something? as i know my Jquery code is obviously selecting input of type text why it is affecting the tags