datalist-polyfill.js
function(option, inputValue) {
		var optVal = option.value.toLowerCase(),
			inptVal = inputValue.toLowerCase(),
			label = option.getAttribute('label'),
			text = option.text.toLowerCase();

		/*
		"Each option element that is a descendant of the datalist element, that is not disabled, and whose value is a string that isn't the empty string, represents a suggestion. Each suggestion has a value and a label."
		"If appropriate, the user agent should use the suggestion's label and value to identify the suggestion to the user."
		*/
		return Boolean(
			option.disabled === false &&
				((optVal !== '' && optVal.indexOf(inptVal) !== -1) ||
					(label && label.toLowerCase().indexOf(inptVal) !== -1) ||
					(text !== '' && text.indexOf(inptVal) !== -1))
		);
	}
function(option, inputValue) {
		var optVal = option.value.toLowerCase(),
			inptVal = inputValue.toLowerCase(),
			label = option.getAttribute('label'),
			text = option.text.toLowerCase();

		/*
		"Each option element that is a descendant of the datalist element, that is not disabled, and whose value is a string that isn't the empty string, represents a suggestion. Each suggestion has a value and a label."
		"If appropriate, the user agent should use the suggestion's label and value to identify the suggestion to the user."
		*/
		return Boolean(
			option.disabled === false &&
				((optVal !== '' && optVal.indexOf(inptVal) !== -1) ||
					(label && label.toLowerCase().indexOf(inptVal) !== -1) ||
					(text !== '' && text.indexOf(inptVal) !== -1))
		);
	}
function ( option , inputValue ) { var optVal = option . value . toLowerCase ( ) , inptVal = inputValue . toLowerCase ( ) , label = option . getAttribute ( 'label' ) , text = option . text . toLowerCase ( ) ; /*
		"Each option element that is a descendant of the datalist element, that is not disabled, and whose value is a string that isn't the empty string, represents a suggestion. Each suggestion has a value and a label."
		"If appropriate, the user agent should use the suggestion's label and value to identify the suggestion to the user."
		*/ return Boolean ( option . disabled === false && ( ( optVal !== '' && optVal . indexOf ( inptVal ) !== - 1 ) || ( label && label . toLowerCase ( ) . indexOf ( inptVal ) !== - 1 ) || ( text !== '' && text . indexOf ( inptVal ) !== - 1 ) ) ) ; }
Check for whether this is a valid suggestion
Check for whether this is a valid suggestion