JSFiddle - React, Tailwind, and code Playground

HTML

<textarea rows="25" cols="50" id="myTextArea"></textarea>

JavaScript

function getPlainText( strSrc ) {
	var resultStr = "";
    
    // Ignore the <p> tag if it is in very start of the text
    if(strSrc.indexOf('<p>') == 0)
        resultStr = strSrc.substring(3);
    
	// Replace <p> with two newlines
    resultStr = resultStr.replace(/<p>/gi, "\r\n\r\n");
	// Replace <br /> with one newline
    resultStr = resultStr.replace(/<br \/>/gi, "\r\n");
    resultStr = resultStr.replace(/<br>/gi, "\r\n");
	
	//-+-+-+-+-+-+-+-+-+-+-+
	// Strip off other HTML tags.
	//-+-+-+-+-+-+-+-+-+-+-+
	
	return  resultStr.replace( /<[^<|>]+?>/gi,'' );
}

var str ="<p>first line<br />second line <otherTag>Other Html tag data</otherTag></p><p>third line<br />fourth line</p>";
$("#myTextArea").val( getPlainText(str) );