JSFiddle - React, Tailwind, and code Playground

by luizpaulo165

HTML

<textarea name="text" id="text-box" cols="30" rows="10"></textarea>
<a href="#" id="print-text">Pegar texto</a>

JavaScript

$(document).ready(function(){
    $('#print-text').click(function(e){
        e.preventDefault();
        
        // pega as texto da caixa de texto
        var textoBox = $('#text-box').val();
        alert(textoBox);
    });
});