Simple Keyword Search Bar

Using Harlowe 3.2.3

I was wondering if anyone could help me tweak a bit of code?

I’m using this search bar, but at the moment it only outputs results for the result with the highest match. I’d like to modify it so that it displays all matches in a list. I’ve been trying to edit it for hours with no avail-- I just don’t know enough about javascript to be able to manage it.

Any help is appreciated!!

There are a number of ways you can achieve the outcome you want, depending on how you want the output to look.

The following replacement of the $(document).on('change', 'input[name=search-box]' related JavaScript creates an unordered list of terms that match the search input.

$(document).on('change', 'input[name=search-box]', function (e) {
		string = $(this).val(),

	string = string.replace(/[^A-Za-z0-9\s]/, ' ');
	string = string.replace(/[\s\s+]/, ' ');
	string = string.trim();
	string = string.split(' ');

	content = '<ul>';
	termList.forEach(function (term) {
		if ( > 0) {
			content += '<li>' + term.handle + ': ' + term.description + '</li>';
	content += '</ul>';


Thank you so much!