How to hide brb in a textarea

0

I'm doing a platform of streaming type YouNow , I've already done everything but I have a problem with the chat .

I want to make a chat where the text goes up and do not leave that box, my only alternative is a textarea.

but now my question is how can I hide the tags - (< br > < b > < div >)

<?php 
if ($_POST) {
    $name = $_POST['name'];
    $content = $_POST['commentContent'];
    $handle = fopen("comentarios.php","a");
    fwrite($handle,"<b>".$name. "</b>:<br>". $content. "<br><br>");
    fclose($handle);
}



 ?>
 
 <textarea id="areadetexto">
                <div id="comentarios">
                <div id="comentario"> <?php include "comentarios.php"; ?><br/></div>
            </textarea>

The problem is that I can not find any information

    
asked by danielmeza 02.09.2018 в 03:47
source

2 answers

0

I think it has a bad approach, because it would be ideal to use a container, and inside show the messages with a p tag that is generated dynamically. Even so, you can do it in the following way:

<txtarea>
<pre>
hola
mundo
</pre>
</txtarea>

The pre tag allows you to display preformatted text, even showing indentation and spaces.

I hope I helped you. Good luck!

    
answered by 02.09.2018 в 04:11
0

clean the text process js: texto.replace(/(<([^>]+)>)/ig,""); this function allows you to clean the tags of the text, I hope it helps.

    
answered by 03.09.2018 в 17:07