以下是我的代码:
$('#cow_id_2').select2({
allowClear: true,
placeholder: "Search a cow/dam ID",
formatNoMatches: function (term) {
return "<a href=/'http://google.com/'>Add</a>";
}
});
Run Code Online (Sandbox Code Playgroud)
当我尝试添加链接时,插件就会停止工作.我使用的是Select2 4.0.3版本