JSFiddle - React, Tailwind, and code Playground
HTML
<h1>Note Generator</h1>
<div class="left">
CSTemplates
<p>
<select class="c10" onchange="showCSTemplates(this);">
<option selected="selected" value="" id="Templates">Please select a template...</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>
</p>
<p>
<textarea cols="30" rows="20" readonly="readonly" id="CSTemplates">
Templates will auto-populate
here depending on the
selection made from the
[CSTemplates]
drop-down list.
</textarea>
</p>
</div><!--left ends here-->
JavaScript
function showCSTemplates(sel){
locations =[ "", /*this remains blank for first selection in drop-down list*/
/*option 1*/
" This is template 1 that will appear in a textarea keeping its formatting as is. ",
/*option 2*/
" This is template 2 that will appear in a textarea keeping its formatting as is. Credentials: Contact Info: ",
/*option 3*/
" This is template 3 that will appear in a textarea keeping its formatting as is. Donec tortor lorem, ornare vitae commodo nec, sagittis et nunc. Maecenas sagittis quam ",
/*option 4*/
"etc",
/*option 5*/
"etc...", ];
srcLocation = locations [sel.selectedIndex];
if (srcLocation != undefined && srcLocation != "") {
document.getElementById('CSTemplates').innerHTML= srcLocation;
}
}