datalist-polyfill.js
function(event) {
		var input = event.target,
			datalist = input.list;

		if (
			!input.matches('input[list]') ||
			!input.matches('.' + classNameInput) ||
			!datalist
		) {
			return;
		}

		// Query for related option - and escaping the value as doublequotes wouldn't work
		var option = datalist.querySelector(
			'option[value="' +
				getInputValue(input).replace(/\\([\s\S])|(")/g, '\\$1$2') +
				'"]'
		);

		// We're using .getAttribute instead of .dataset here for IE10
		if (option && option.getAttribute('data-originalvalue')) {
			setInputValue(input, option.getAttribute('data-originalvalue'));
		}
	}
function(event) {
		var input = event.target,
			datalist = input.list;

		if (
			!input.matches('input[list]') ||
			!input.matches('.' + classNameInput) ||
			!datalist
		) {
			return;
		}

		// Query for related option - and escaping the value as doublequotes wouldn't work
		var option = datalist.querySelector(
			'option[value="' +
				getInputValue(input).replace(/\\([\s\S])|(")/g, '\\$1$2') +
				'"]'
		);

		// We're using .getAttribute instead of .dataset here for IE10
		if (option && option.getAttribute('data-originalvalue')) {
			setInputValue(input, option.getAttribute('data-originalvalue'));
		}
	}
function ( event ) { var input = event . target , datalist = input . list ; if ( ! input . matches ( 'input[list]' ) || ! input . matches ( '.' + classNameInput ) || ! datalist ) { return ; } // Query for related option - and escaping the value as doublequotes wouldn't work var option = datalist . querySelector ( 'option[value="' + getInputValue ( input ) . replace ( / \\([\s\S])|(") / g , '\\$1$2' ) + '"]' ) ; // We're using .getAttribute instead of .dataset here for IE10 if ( option && option . getAttribute ( 'data-originalvalue' ) ) { setInputValue ( input , option . getAttribute ( 'data-originalvalue' ) ) ; } }
Check for the input and probably replace by correct options elements value
Check for the input and probably replace by correct options elements value