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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:44:40+00:00 2026-06-10T11:44:40+00:00

Sorry, my Jquery is WEAK! But here’s what i have…. $(function () { if

  • 0

Sorry, my Jquery is WEAK!

But here’s what i have….

     $(function () {
              if (document.calc.loan.value > 1000)
              {
                  ("#link").value = "<a href='dump'></a>";
              }
              else {
                  ("#link").value = "<a href='dump2'></a>";
              }
     });

<form name=calc method=POST>
<input type=text name=loan id="amount" />
<div id="link"></div>
</form>

So I want the content of #link to change if the Loan Input is over 1000 as they type

  • 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-10T11:44:42+00:00Added an answer on June 10, 2026 at 11:44 am

    Just use .html() like below to modify the content of the div.

     $(function () {
         if (document.calc.loan.value > 1000) 
         {
            $("#link").html("<a href='dump'></a>");
         }
         else {
            $("#link").html("<a href='dump2'></a>");
         }
     });
    

    Also you were missing $. Changed ('#link') -> $('#link')

    I just noticed that you want as he types in the input field. In that case you need an onkeyup event handler to check the value typed in the input box.

    $(function () {
          $('#amount').on('keyup', function () {
               var amount = parseFloat(this.value);
    
               if (!isNaN(amount) && amount > 1000) {
                 $("#link").html("<a href='dump'></a>");
               } else {
                 $("#link").html("<a href='dump2'></a>");
               }
          }); 
    });
    

    Edit: Changed from onchange to onkeyup.

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

Sidebar

Related Questions

Hey, sorry to be such a nuisance, but I have another jQuery problem. Same
hi guys sorry to ask this one again but i have some jquery that
Sorry guys, didn't know how to word this one. Still learning jquery and have
Sorry if this too open ended for this forum, but here goes. I mostly
Sorry if this is basic, but I have been dealing with figuring this out
Sorry couldn't think of a better title. :) Here goes, I have been pulling
sorry, im new in jquery. I have this code on tag: <img class=fluidimage src=img/picture1.jpg/>
Sorry to be posting this question. :( But I have spent almost the entire
Here is my JQuery: $(window).load(function(){ $(.mobile-handle).css({height: $(ul#active-tasks li).height()}); }) Here is my view code:
I'm new to jquery so i'm sorry if this is simple. I have looked

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.