This doesn't have anything to do with escaping quotes but rather with string concatenation (the + operator). What you want to do is concatenate the following strings
1. <a href="
2. The content of addr[ri]
4. The content of addr[ri]
Between each part of those strings you will have to use the + operator
rl.innerHTML='<a href="' + addr[ri] + '">' + addr[ri] + '</a>';