Nesting quotes in JavaScript/HTML
You need to use proper escaping/encoding. Either in HTML using character references:
<p onclick="exampleFunc('<div id="divId"></div>');">Some Text</p>
Or in JavaScript using string escape sequences:
<p onclick="exampleFunc('\x3Cdiv\x20id\x3D\x22divId\x22\x3E\x3C/div\x3E');">Some Text</p>
Edit: this is not a solution for JavaScript in HTML, but for JavaScript only. My bad...
eval('eval(\"eval(\\\"alert(\\\\\\\"Now I\\\\\\\\\\\\\\\'m confused!\\\\\\\")\\\")\")');
Link. It's "recursive escaping".