I need to escape variables for html inside a function in JS, I have something like this:
function (foo1) {
var cat = '<li id="'+ foo1.*** +'"></li>'
+ '<div aria-label="' + foo1.*** + '" tabindex = "0">'
+ '<button id="'+ foo1.*** +'"></button>'
+ '</div>'
}
Can this escape be accomplished somehow?
Thanks for the help.