datalist-polyfill.js
function(input, datalistSelectValue) {
		var lastSeperator;

		// In case of type=email and multiple attribute, we need to set up the resulting inputs value differently
		input.value =
			// Using .getAttribute here for IE9 purpose - elsewhere it wouldn't return the newer HTML5 values correctly
			input.getAttribute('type') === 'email' &&
			input.getAttribute('multiple') !== null &&
			(lastSeperator = input.value.lastIndexOf(',')) > -1
				? input.value.slice(0, lastSeperator) + ',' + datalistSelectValue
				: datalistSelectValue;
	}
function(input, datalistSelectValue) {
		var lastSeperator;

		// In case of type=email and multiple attribute, we need to set up the resulting inputs value differently
		input.value =
			// Using .getAttribute here for IE9 purpose - elsewhere it wouldn't return the newer HTML5 values correctly
			input.getAttribute('type') === 'email' &&
			input.getAttribute('multiple') !== null &&
			(lastSeperator = input.value.lastIndexOf(',')) > -1
				? input.value.slice(0, lastSeperator) + ',' + datalistSelectValue
				: datalistSelectValue;
	}
function ( input , datalistSelectValue ) { var lastSeperator ; // In case of type=email and multiple attribute, we need to set up the resulting inputs value differently input . value = // Using .getAttribute here for IE9 purpose - elsewhere it wouldn't return the newer HTML5 values correctly input . getAttribute ( 'type' ) === 'email' && input . getAttribute ( 'multiple' ) !== null && ( lastSeperator = input . value . lastIndexOf ( ',' ) ) > - 1 ? input . value . slice ( 0 , lastSeperator ) + ',' + datalistSelectValue : datalistSelectValue ; }
Set the input value for dividing regular and mail types
Set the input value for dividing regular and mail types