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 6207009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:33:07+00:00 2026-05-24T05:33:07+00:00

I need to dynamically change the href of an achor link on the screen

  • 0

I need to dynamically change the href of an achor link on the screen to what the user is typing into an input box. I have jquery loaded if necessary or can use raw javascript.

Extra note that may or may not be important: The div that contains the input box and the anchor link is itself dynamic (may or may not be on the screen depending on the user’s actions) so I am going to use the ‘live’ function of jquery to run the code when the div box appears. This is necessary since I am using various posts to navigate through the website (it is for mobile web platforms).

Thanks for any help

Edit: Hey thanks for answers my question they are great and put me in the right direction but I have realised I didn’t think through my question (sorry), what I want to actually do is append what they type onto the END of an existing href (it’s a Get request to an api) So if they type ‘example’ it will add ‘example’ onto the href of ‘www.apitest.com?variable=’. It would be really helpful if you could tweak your example to do this. Thank you.

  • 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-05-24T05:33:08+00:00Added an answer on May 24, 2026 at 5:33 am

    I don’t know the structure of you page, so you need to replace $(‘input’), $(‘a’) with selectors of input and anchor according to your page.

    var apiUrl = 'www.apitest.com?variable=';
    $('input').live('keyup', function(){
        $('a').attr('href', apiUrl+$(this).val());
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a system where we need to dynamically change what happens at the
I have a Flash widget (kind of player). I need to dynamically change height
I need to dynamically change the loaded keys through a parameter. Imagine there yould
I need to dynamically change the style with jQuery on a select menu. Here's
I need to change ASPxGridView SettingsLoadingPanel dynamically (from code behind if is possible). For
I need to dynamically generate radio or checkbox by jQuery. I use the following
I need to dynamically build a list of textboxes using javascript and jquery. The
I need to dynamically load banner images into a HTML5 app and would like
I have a situation where I need to dynamically build up a list of
I have a GridView that I need to dynamically add TemplateField elements to. My

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.