awesomplete.js
function (i) {
		var lis = this.ul.children;

		if (this.selected) {
			lis[this.index].setAttribute("aria-selected", "false");
		}

		this.index = i;

		if (i > -1 && lis.length > 0) {
			lis[i].setAttribute("aria-selected", "true");

			this.status.textContent = lis[i].textContent + ", list item " + (i + 1) + " of " + lis.length;

            this.input.setAttribute("aria-activedescendant", this.ul.id + "_item_" + this.index);

			// scroll to highlighted element in case parent's height is fixed
			this.ul.scrollTop = lis[i].offsetTop - this.ul.clientHeight + lis[i].clientHeight;

			$.fire(this.input, "awesomplete-highlight", {
				text: this.suggestions[this.index]
			});
		}
	}
function (i) {
		var lis = this.ul.children;

		if (this.selected) {
			lis[this.index].setAttribute("aria-selected", "false");
		}

		this.index = i;

		if (i > -1 && lis.length > 0) {
			lis[i].setAttribute("aria-selected", "true");

			this.status.textContent = lis[i].textContent + ", list item " + (i + 1) + " of " + lis.length;

            this.input.setAttribute("aria-activedescendant", this.ul.id + "_item_" + this.index);

			// scroll to highlighted element in case parent's height is fixed
			this.ul.scrollTop = lis[i].offsetTop - this.ul.clientHeight + lis[i].clientHeight;

			$.fire(this.input, "awesomplete-highlight", {
				text: this.suggestions[this.index]
			});
		}
	}
function ( i ) { var lis = this . ul . children ; if ( this . selected ) { lis [ this . index ] . setAttribute ( "aria-selected" , "false" ) ; } this . index = i ; if ( i > - 1 && lis . length > 0 ) { lis [ i ] . setAttribute ( "aria-selected" , "true" ) ; this . status . textContent = lis [ i ] . textContent + ", list item " + ( i + 1 ) + " of " + lis . length ; this . input . setAttribute ( "aria-activedescendant" , this . ul . id + "_item_" + this . index ) ; // scroll to highlighted element in case parent's height is fixed this . ul . scrollTop = lis [ i ] . offsetTop - this . ul . clientHeight + lis [ i ] . clientHeight ; $ . fire ( this . input , "awesomplete-highlight" , { text : this . suggestions [ this . index ] } ) ; } }
Should not be used, highlights specific item without any checks!
Should not be used highlights specific item without any checks!