I am trying to pass a variable inside a JavaScript function. The problem I'm failing to figure out how to escape string to send that variable inside a double quote. There are tons of answers on this but I couldn't use them correctly.
for (var k = 0; k < districts[division].length; k++) {
$('#district_list').append('<li class="byebooklist"><a href="javascript:getUniversity(' + districts[division][k] + ');">' + districts[division][k] + '</a></li>');
}
How to pass the parameter to the getUniversity() function inside a double quote?