function deleteLogoOrTextbyAjax(rowID, tableName){
alert(rowID);
alert(tableName);
jQuery.ajax({
type: "POST",
url: "/cycling/deleteLogoOrTextbyAjax",
//dataType: 'json',
data: { rowID: rowID, tableName: tableName },
success: function (res) {
$( "div[dbid=rowID]" ).remove(); //here i need help
}
});
}
传递rowID,我想删除带有属性' dbid'的div。等于传递的值rowID。
$( "div[dbid=rowID]" ).remove();
以上代码无效
答案 0 :(得分:1)
用+符号连接
$( "div[dbid="+rowID+"]" ).remove();