I need to call a function with parameters in a jQuery append method and want to pass a variable named image but I keep getting syntax error even when I pass a static value
$("#officialDiv").append("<a onclick='remove('" + image + "');' class='btn btn-danger btn-sm'></a>");
or static
$("#officialDiv").append("<a onclick='remove('test');' class='btn btn-danger btn-sm'></a>");
function remove(file) {
}
below a screenshot of the error

image?