我正在尝试单击一个 LI,并将该 li 的值发送到搜索框输入作为要搜索的值。
我可以从 LI 中剥离类,但不知道如何剥离 LI 本身。我可能完全错了。
$(function(){
//var art = $('li.inliner').val();
$('li.inliner').on('click',function(){// select the artist from the ul
$( this ).clone() //copy it
.removeClass("inliner") //remove the inliner class
//remove the li from the clone??
.appendTo( "input(value)?? ); //this needs to be inserted into the search input as the value
});
})
目前我可以将点击的 LI 发送到删除类的 div,但它仍然是一个 LI。我也不知道如何使它成为输入值。任何帮助表示赞赏。