JSFiddle - React, Tailwind, and code Playground

HTML

<form>

     <textarea rows='30' cols='50' id='lol'></textarea>
     <button type="button" onclick="getVocabels()">Auswahl</button>     
     
</form>

JavaScript

function getVocabels() {
    var textArea = document.getElementById("lol")
    var textAreaContent = textArea.value.split(/\n/)
    textArea.value = ''
    for (var i = 0; i < 25; i++) {
     
       textArea.value = textArea.value + 
           textAreaContent[Math.floor((Math.random() * textAreaContent.length-1) + 1)] + '\n'          

    }
   
}