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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:28:56+00:00 2026-05-26T06:28:56+00:00

I have a task to complete for work. I have a HTML page with

  • 0

I have a task to complete for work. I have a HTML page with a table of products. I need to present a search box that allows the user to enter a product to search for, then use jQuery to search the page for words that match and then attach them in a div above the table as well as grabbing the href that they link to.

It’s not possible to search the database as I don’t have access to the server, has anyone done this before or seen any good resources or plugins. It seems a relatively easy task but I’m short on time.

Here’s the following code I just put together, works great except I’m having trouble comparing against lowerCase / upperCase. Any ideas.

$(document).ready(function() {
$('#searchButton').click(function() {
$(".searchresults").slideUp('fast', function(){

var arr = [];
var htmlsbr = "Your Search Results:<br />";

$('a:contains("' + $('#searchText').val() + '")').each(function() {
                                   arr.push($(this).text()+";"+$(this).attr('href'));
});

$.each(arr, function(index, value) { 
htmlsbr = htmlsbr + '<p><a href="'+value.split(';')[1]+'" name="'+value.split(';    ')[0]+'">'+value.split(';')[0]+'</a></p>';
});

$(".searchresults").append(htmlsbr).slideDown('slow');

}).html(' ');
});
});

</script>
<style>
p {color: brown;}
p.highlight {background-color: orange;}
body {background-color: beige;}
</style>
</head>
<body>
<div class="searchresults"></div>
<input id="searchText" value="second" />
<button id="searchButton">Search</button>
<p><a href="http://google.com" rel="this is the first entry.">This is the first entry.    </a></p>
<p><a href="http://ebay.com" rel="this is the second entry">This is the second entry.    </a></p>
<p><a href="http://msn.com" rel="this is the third entry.">This is the third entry.    </a></p>
<p><a href="http://yahoo.com" rel="this is the fourth entry.">This is the fourth entry.    </a></p>'
  • 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-26T06:28:57+00:00Added an answer on May 26, 2026 at 6:28 am

    You could use the jQuery Replace Text plugin

    Example (not tested) –

    jQuery('selector').replaceText($("#yourtextbox").val(),function (str) {
        //do your stuff
    }));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a task to show digital clock (with minutes precision) on HTML page
[Updated a bit] I have a Task model that has a :completed boolean attribute.
I have a Task object that has a collection of Label objects ... in
We have an ASP.Net application that provides administrators to work with and perform operations
I have a question about how to present some structured data using HTML. I
I have a method that queues some work to be executed asynchronously. I'd like
I have the following task to complete: based on a dataset, I have to
I have a task which I need to run in the background in my
I have an application that I need to automate where at a certain time
I have this jQuery tooltip that works fine on initial page loads. The problem

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.