Given that I have a JavaScript section in my HTML page like :
<script language="JavaScript">
...
</script>
I am aware of the function :
document.write(“Hello World”) ;
But, how can I can include the following HTML :
<select name="database_subcollection" multiple="true" size="5" onsubmit="document.getElementById('MAIN').submit()">
If I write it like :
document.write('<select name="database_subcollection" multiple="true" size="5" onsubmit="document.getElementById('MAIN').submit()">') ;
It complains. So, I would like your help in overcoming this.
Thank you.
Using:
You needed to escape
('MAIN')with\eg(\'MAIN\')assuming containing quotes are single quotes.Working Example