I'm trying to generate javascript code snippet and then put it to textarea, so that user could copy ready javascript code.
How to store something like this
"<script type='text/javascript'>
function init_map(){
var myOptions = {
zoom:14,center:new google.maps.LatLng(33.7593664,-118.14817399999998),
mapTypeId: google.maps.MapTypeId.ROADMAP};
}
</script>"
in javascript variable?

\nor\r\n, if you want line breaks in your literal, escape them with a single backslash tootext/template, give it anidand usedocument.getElementById('id').textContentto get the string. jsfiddle.net/WfF57/1