Scroll to an element with jQuery

0 votes

I have this input element:

  <input type="text" class="textfield" value="" id="subject" name="subject">

Then I have some other elements, like other tag's & <textarea> tag's, etc...

When the user clicks on the <input id="#subject">, the page should scroll to the page's last element, and it should do so with a nice animation (It should be a scroll to bottom and not to top).

The last item of the page is a submit button with #submit:

<input type="submit" class="submit" id="submit" name="submit" value="Ok, Done.">

The animation should not be too fast and should be fluid.

I am running the latest jQuery version. I prefer to not install any plugin but to use the default jQuery features to achieve this.

Jul 1, 2022 in Web Development by gaurav
• 23,260 points
513 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Web Development

0 votes
1 answer

html5 video with jquery and inview - how to point to the right video element?

You can make use of this. For more ...READ MORE

answered Aug 5, 2022 in Web Development by rajatha
• 7,680 points
1,986 views
0 votes
0 answers

How to update HTML element with jQuery and Galleria?

I am using Galleria for a slideshow. ...READ MORE

Aug 11, 2022 in Web Development by gaurav
• 23,260 points
922 views
0 votes
0 answers

Using jQuery to countdown from 90 seconds beginning on the click of an element

Hi I was wondering if anyone can ...READ MORE

Aug 22, 2022 in Web Development by gaurav
• 23,260 points
538 views
0 votes
1 answer

How can you add a class to an element using jQuery?

For adding a class to an element ...READ MORE

answered Nov 13 in Web Development by kavya
72 views
0 votes
1 answer

How do you use jQuery to hide an element?

The .hide() method in jQuery animates the ...READ MORE

answered Nov 13 in Web Development by kavya
58 views
0 votes
1 answer

How to replace html element with ajax response?

Hello @kartik, Assuming you are replacing your products, ...READ MORE

answered Jul 8, 2020 in Web Development by Niroj
• 82,840 points
10,606 views
0 votes
1 answer

Smooth scrolling when clicking an anchor link

document.querySelectorAll('a[href^="#"]').forEach(anchor => { anchor.addEventListener('click', ...READ MORE

answered Jun 20, 2022 in JQuery by rajatha
• 7,680 points
2,240 views
0 votes
1 answer

Smooth scroll to div id jQuery

You need to animate the html, body $("#button").click(function() { ...READ MORE

answered Jun 23, 2022 in Web Development by rajatha
• 7,680 points
3,270 views
0 votes
0 answers

How to scroll to top of page with JavaScript/jQuery?

Is there a way to control browser ...READ MORE

Jul 1, 2022 in Web Development by gaurav
• 23,260 points
2,278 views
0 votes
0 answers

Smooth scrolling when clicking an anchor link

My page has a few hyperlinks. When ...READ MORE

Jul 22, 2022 in CSS by Edureka
• 13,620 points
532 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP