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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:53:37+00:00 2026-05-17T17:53:37+00:00

Is there an equivalent function in JavaScript or jQuery similar to strpos in PHP?

  • 0

Is there an equivalent function in JavaScript or jQuery similar to strpos in PHP?

I want to locate a string inside an element on a page. The string I’m looking for is:

td class="SeparateColumn"

I would like something where I can run it like this to find:

if $("anystring")
  then do it
  • 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-17T17:53:38+00:00Added an answer on May 17, 2026 at 5:53 pm

    I assume you mean check whether a string contains a character, and the position in the string – you’d like to use the indexOf() method of a string in JS. Here are the relevant docs.


    Okay, so you’d like to search the whole page! The :contains() selector will do that. See the jQuery docs for :contains.

    To search every element in the page, use

    var has_string = $('*:contains("search text")');
    

    If you get jQuery elements back, then the search was a success. For example, on this very page

    var has_string=$('*:contains("Alex JL")').length
    //has_string is 18
    var has_string=$('*:contains("horsey rodeo")').length
    //has_string if 0. So, you could an `if` on this and it would work as expected.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm wondering if there is an equivalent function to PHP's call_user_func() in ASP.NET application.
Using Javascript, is there an equivalent function or functionality so VBScript's IsEmpty function? The
Is there a built in function equivalent to .NET's Guid.NewGuid(); in Cocoa? My desire
Is there a C# equivalent for the VB.NET FormatNumber function? I.e.: JSArrayString += ^
Is there any Ruby equivalent for Python's builtin zip function? If not, what is
Is there a rough equivalent to the Linux/Unix stdio.h popen() function in the Win32
Is there any function in c# equivalent to C's stdio function ungetc() ?
Is there anything in Clojure that is equivalent to Common Lisp's symbol-name function?
I am trying to find an equivalent for the following jQuery javascript: var x1
Are there any nvl() equivalent functions in SQL? Or something close enough to be

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.