JSFiddle - React, Tailwind, and code Playground

by j08691

HTML

<select id="dropdown">
    <option value="">None</option>
    <option value="textArray1">text1</option>
    <option value="textArray2">text2</option>
    <option value="textArray3">text3</option>
    <option value="textArray4">text4</option>
</select>

<br /><br />

<textarea id="mytext"></textarea>

JavaScript

var textArray1 = 'this is going to be a long sting of text for text 1 value';
var textArray2 = 'this is going to be a long sting of text for text 2 value';
var textArray3 = 'this is going to be a long sting of text for text 3 value';
var textArray4 = 'this is going to be a long sting of text for text 4 value';

var mytextbox = document.getElementById('mytext');
var mydropdown = document.getElementById('dropdown');

mydropdown.onchange = function(){
      mytextbox.value = mytextbox.value  + window[this.value]; //to appened
     //mytextbox.innerHTML = this.value;
}