jquery page search [testing]

just testing this one at the moment for a in page search. 

Based on this: https://codepen.io/chriscoyier/pen/ExgqWab 

I would like to adapt this code to search through page elements and maybe highlight them somehow. 

* not currently working


<input id="filter-input" placeholder="Type in here to filter results" type="search"/>
<ol id="filter-results">
  <li>Test Space</li>


$.expr[":"].CIcontains = $.expr.createPseudo(function (arg) {
  return function (elem) {
    return $(elem).text().toUpperCase().indexOf(arg.toUpperCase()) >= 0;

// Every time a key is clicked
$("#filter-input").keyup(function () {
  // get the text from the box
  var curr_text = $(this).val();
  // pass it to the function

$("#close").click(function () {
  var curr_text = $(this).val();

function filterResults(curr_text) {
  // hide all results
  $("#filter-results li").hide();
  // ... except those which are selected
  $("#filter-results li:CIcontains('" + curr_text + "')").show();


  1. Bob
  2. Smith
  3. Moo
  4. Test Space

No Items Found.

Add Comment
Type in a Nick Name here
Page Views

This page has been viewed 150 times.

Search Code
Search Code by entering your search text above.

This is my test area for webdev. I keep a collection of code snippits here, mostly for my reference. Also if i find a good site, i usually add it here.


Random Quote