JSFiddle - React, Tailwind, and code Playground

HTML

<textarea></textarea>
<button>Submit</button>
<div id='mydiv'></div>

JavaScript

$('button').click(function(){
    var links = $('textarea').val().split('\n');
    
    $.each(links,function(){
        if( this.substr(0, 7) == 'http://' )
            $('#mydiv').append(this + '<br/>');
        else
            $('#mydiv').append('<span style="color:red;">error: '+this+'</span><br/>');
    });
    return false;
});