Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7933269
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T21:16:45+00:00 2026-06-03T21:16:45+00:00

I put an A tag on my page , and when the user clicks

  • 0

I put an A tag on my page , and when the user clicks on it, the page will have a new input field to write in information, like this:

HTML code

<a href="" class="smallLink" onclick="return ioAddNewContent()">new info</a>

I don’t want to add hash to the url after clicking “new info” so I make the javascript return null, like this:

javascript code

    function ioAddNewContent(){
    var bigLi = document.getElementById('ioAddContents');
    var p = document.createElement('p');
    var label=document.createElement('label');
    var input = document.createElement('input');
    var a = document.createElement('a');
    label.setAttribute('class', 'ioAddOneContent');
    label.innerHTML='write one info';
    input.setAttribute('type', 'text');
    input.setAttribute('class', 'longInput');
    a.setAttribute('href', '');
    a.setAttribute('class', 'smallLink');
    a.setAttribute('onclick', 'return ioAddNewContent()');
    a.innerHTML=' new info';
    p.appendChild(label);
    p.appendChild(input);
    p.appendChild(a);
    bigLi.appendChild(p);
    return false;
}

after clicking the “new info” 10 times the user have to scroll down to see the new input field , i don’t want that , i want with every click of the “new info” the screen should go to that new input field ,

i know i can do that by adding A tag with a name = “here ” on the html code and then put `window.location(“#here”)` on the javascript code but i want to do that dynamic

when user click to add the new input field , the screen should automaticly scroll to that new input field

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T21:16:46+00:00Added an answer on June 3, 2026 at 9:16 pm

    Use .focus() and .last()

    $('a.smallLink').last().focus();
    

    This is part of the jQuery set, not sure if you are using a library.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have html page with a link when user clicked that link a new
I have a <input/> tag on jsp whare user can put company names and
a I have some images on page and I want to put <span> tag
I have an anchor tag: <a href="file.pdf">Download Me</a> I would like for the user
I would like to put user controls on pages without registering the tag at
Where do you personally prefer to put html tag handlers with JQuery-powered Html page
I would like to put jQuery at the bottom of the body tag but
I know that I should put all the html elements in body tag, but
My script tracks clicks on a client's page and uploads this to my server(let's
I'm working on the Web GUI of an appliance-like product. I have an HTML

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.