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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:15:37+00:00 2026-05-23T08:15:37+00:00

How can you use the :contain() on an input field, e.g. #inputfield contains a

  • 0

How can you use the :contain() on an input field, e.g.

#inputfield contains a dynamic value of 5.938 and I want to use $("#inputfield:contains('5.938')").

But that won’t work, I’ve provided a demo at jsFiddle.

I don’t want to use if(element.val() == '5.938') because I need a provisional selector instead doing an if/else statement.

I also don’t mean by using [value=5.938] because the value will change.

  • 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-23T08:15:37+00:00Added an answer on May 23, 2026 at 8:15 am

    Due to @Neal’s answer, you need to use some sort of conditional. A simple selector won’t work. .filter() will suffice, however:

    $('#inputfield').filter(function ()
    {
        return $(this).val() == '5.938';
    });
    

    That said, it looks like you’re using an ID selector, which can select at most one element, so .filter() is overkill — if...else really makes the most sense in that case.

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

Sidebar

Related Questions

I've got a few controllers here at work that contain methods I can use
How can I use Membership.GeneratePassword to return a password that ONLY contains alpha or
You can use App.config; but it only supports key/value pairs. You can use .Net
How can I disable an input-field with jQuery using GM if the url contains
How can i use jquery to check for the empty input field / to
I'm wondering how you can use Yahoo Pipes to get any tweets than contain
I can use VS08's MFC/ActiveX template to create a C++ ActiveX object that I
I have a page which displays a form that a logged-in user can use
How can i create a main page with codeigniter? That page should contain a
I've got an input field which contains the file mode used for chmod. If

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.