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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T07:27:53+00:00 2026-05-18T07:27:53+00:00

Using the keyup on jQuery, is there a way to check a what textfield

  • 0

Using the keyup on jQuery, is there a way to check a what textfield currently has in it’s box?

I mean if the textbox currently does not have the word ‘apples’ then do a jQuery function, then if it does have the word apples… then do not do the jQuery function that happens when ‘apples’ is not typed.

I hope that made sense. I tried using CASES and keyup but I couldn’t get it to work.

Is this possible?

  • 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-18T07:27:54+00:00Added an answer on May 18, 2026 at 7:27 am

    You can use jQuery’s keyup and val() function after selecting the input:

    HTML:

    <input id="granny_smith"/>
    

    JavaScript:

    $("#granny_smith").keyup(function() {
        if ($(this).val() === "apples") {
            alert("apples");
            // Do apples function
        }
        else {
            // Do !apples function
        }
    });
    

    Working example: http://jsfiddle.net/uKnJB/

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

Sidebar

Related Questions

I'm using jQuery to display a counter above a textbox of how many characters
I have the follwing jQuery: $(#textArea).keyup(function(){ var textAreaValue = $(textArea); if(!textArea.value.indexOf(some string)){ textArea.value =
I am using Jquery .keyup and .val to grab what I type into a
I'm trying to implement a search box using php and jquery (the seach results
I'm using jQuery ajax to give the user some visual validation feedback. I have
I'm currently using jquery's ajax feature or whatever they call it. To load data
I am using jQuery.autocomplete(1.02) on my search box and I want exact string and
(using jQuery 1.4.4 edition) The title of the question might not be that clear,
I am using the latest and greatest jQuery. I have a form with three
I am using rails with jquery gem. I have the following in my application.js

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.