I cannot find a way to escape second tier html quotes in a php echo:
PHP
echo "<div id='myDiv'></div>
<select onchange='myfunction(this,"#myDiv")'>
options and such
</select>
";
It seems the escape has to apply to not only php but also to html for them to work. I even tried to save the second argument to myfunction as a php variable and passing it in the echo but then jquery didn't accept this. .. or maybe I just did it wrong.