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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:51:27+00:00 2026-06-10T14:51:27+00:00

Using a small plugin to highlight some text that a user searches for on

  • 0

Using a small plugin to highlight some text that a user searches for on my application:

Johann Burkard Text Highlighting

I am able to use this to highlight a single text string by taking the value of the an input field and passing this to the plugin as a variable:

$(function() { 
    var hightLightme = $("input#searchterm").val();
    $('p').highlight(hightLightme);
});

This works fine for the likes of ‘stackoverflow’ but my search field has the capability of searching for multiple keywords, i.e. stackoverflow, web, dave where the comma acting as an ‘and operator’

As the plugin stands it is looking for ‘stackoverflow, web, dave’ as an exact string and I am at a loss as to how I can code this so it breaks the keywords down and passes them to the plugin as individual keywords to be highlighted?

  • 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-10T14:51:29+00:00Added an answer on June 10, 2026 at 2:51 pm

    Use This instead.

     $(function() { 
    
         var arrayOfKeyWords= $("input#searchterm").val().split(',');
        for (var i=0;i<arrayOfKeyWords.length;i++)
         {
              $('p').highlight(arrayOfKeyWords[i]);
            }
    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am maintaining a small application that has some plugin-like functionality, which is implemented
I'm working on a small app that makes use of the jQuery plugin Fullcalendar.
I have a small Java/Gradle project. I'm using the Application plugin to create a
We are using this excellent plugin for some small sparkline charts. Issue I have
I am creating a small plugin that process some images. Now to report the
I am using the FancyBox plugin and when the user clicks on a small
I'm using the jQuery Youtube plugin to embed a youtube video and use some
I am using jquery tooltip plugin cluetip that is small or very big depending
I'm trying to learn vimscript by writing a small plugin to display marks using
I was working on a small application using a simple binding in JavaFx 2.1

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.