Skip to main content
100%

On-Page Text Search

✓ Published0🌍 Public
Aamundo
Last edited Sep 20, 2010
Created on Apr 6, 2011

Typing a query into the text input triggers a live on-page search that highlights every matching term within the Wikipedia-derived paragraphs. As the user types, the keyup event handler calls jQuery’s `highlight` method, which walks the DOM text nodes and wraps matches in styled `<span>` elements. Removing the query invokes `removeHighlight`, which unwraps those spans and normalizes the text nodes. The code uses jQuery event binding and custom DOM traversal to apply the search visually.

AI-generated description

Similar vizzes