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

  • Home
  • SEARCH
  • 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 6184837
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:36:22+00:00 2026-05-24T01:36:22+00:00

In the dev function below, I’m trying to convert the string to lowercase to

  • 0

In the “dev function” below, I’m trying to convert the string to lowercase to perform a lowercase to lowercase comparison between the string in the “html” variable and the contents of the span tags.

I must be doing something wrong on the dev function when attempting to convert the span to lowercase, since the highlight class does not appear to be attaching…

var html = jQuery('#content').html().toLowerCase();

    //existing function works when the span is preset to lowercase
    jQuery(".my_kw").find("span").filter(function() {
        return html.indexOf(jQuery(this).html()) != -1;
        }).each(function() {
            jQuery(this).addClass('highlight');
        });
    }

    //dev function. Trying to allow for spans to be mixed case, and force to lowercase only for comparison
    jQuery(".my_kw").find("span").filter(function() {
        var kw = jQuery(this).toLowerCase();
        return html.indexOf(kw.html()) != -1;
        }).each(function() {
            jQuery(this).addClass('highlight');
        });
    }
  • 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-24T01:36:23+00:00Added an answer on May 24, 2026 at 1:36 am

    I think you’re missing a call to .html()

    Consider your first call:

    return html.indexOf(jQuery(this).html()) != -1;
    

    and your second:

    var kw = jQuery(this).toLowerCase();
    

    That is, you probably want:

    var kw = jQuery(this).html().toLowerCase();
    return html.indexOf(kw) != -1;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to call a variable for use in another function. The variable
Dev-cpp comes with an example program Jackpot, which has a GetResults function in it:
Ive got a url: http://dev.local/foodies/view?id=bluedaniel and ive got in my bootstrap: protected function _initRoute()
I am using this function in Bash function parse_git_branch { git_status=$(git status 2> /dev/null)
<html> <head> <script type=text/javascript src=js/jquery-1.5.1.min.js></script> <script type=text/javascript src=js/jquery.jeditable.min.js></script> <script type=text/javascript src=js/jquery.jeditable.checkbox.js></script> <script> $(function ()
I am having problems running the below recursive function on our development web server.
i have this jQuery-AJAX code below and a form: <script type=text/javascript> $(document).ready(function () {
I have installed libuuid using the command below. sudo apt-get install uuid-dev And is
UPDATE 3 var local = 'http://localhost:1163/CustomerService.svc/getcustomer?method=?'; var dev = 'http://yourserver.com/CustomerService.svc/GetCustomer?method=?'; $.getJSON(dev, function (customer) {
I am trying to display some text using MessageBox.Show as shown below in a

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.