我正在尝试推进Jquery-autcomplete功能.我希望Jquery-autocomplete在表中创建新行.这到目前为止工作.但我希望Jquery添加一个删除按钮.因此,用户可以删除其中一个添加的项目.
$(document).ready(
function() {
//create an new <tr> <td> in #log
function log( message ) {
$("<tr> <td>" + message + "<input class='Entf' type='button' value ='Entfernen' />" + "</td></tr>").appendTo("#log");
$( "#log" ).attr( "scrollTop", 0 );}
// get the values from a json-source
$( "#REMOTE" ).autocomplete({
source: "json.php",
minLength: 0,
select: function( event, ui ) {
log( ui.item ?
ui.item.value + " aka " + ui.item.id :
"Nothing selected, input was " + this.value );}
});
// this is just a …Run Code Online (Sandbox Code Playgroud)