如何:jQuery 使用“;”自动完成多个值 分号分隔符支持

Man*_*ava 2 javascript jquery jquery-ui

我已将this.value = terms.join( "; " )行从逗号 (,) 更改为 (;) 它对我的第一个建议有用。但是当我输入新单词时分号后没有显示任何建议。我已经下载了jQueryUI 演示

 select: function( event, ui ) {
                var terms = split( this.value );
                // remove the current input
                terms.pop();
                // add the selected item
                terms.push( ui.item.value );
                      // add placeholder to get the comma-and-space at the end
                terms.push( "" );
                this.value = terms.join( "; " );
                return false;
}  
Run Code Online (Sandbox Code Playgroud)

Raj*_*hal 5

function split( val ) {
        return val.split( /\;\s*/ );
    }
Run Code Online (Sandbox Code Playgroud)

按照我上面写的那样改变这个函数......