Search and Highlight

<script>
$(document).ready(function(){
$("#searchInput").keyup(function(){
searchHighlight($(this).val()
)}
)})

function searchHighlight(searchText)
{
if (searchText)
{
$(".highlight").removeClass("highlight");
$("p, .h2-faq").each(function(index, content){
var content = $(content).text(); var searchExp = new RegExp(searchText, "ig");
var matches = content.match(searchExp);
if (matches)
{
console.log(matches)
$(this).html(content.replace(searchExp, function(match){
return "<span class='highlight'>" + match + "</span>";
}));
}
})
}
else
$(".highlight").removeClass("highlight");
}
</script>
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.