<script>
$('#textarea_').on('keyup', function() {
var textareaContentWithJquery = $('#textarea_').val();
var textareaContentWithJavascript = document.getElementById('textarea_').value;
});
</script>
<textarea cols="20" id="textarea_" name="textarea_" rows="2">
Some text in textarea here is created without pressing enter,
just plain text. But how can i get the position
of newline markup from textarea so that i can put <br> there?
</textarea>
ich bekomme wert von textarea so (plain text); Hier wird ein Text im Textbereich erstellt, ohne die Eingabetaste zu drücken, nur Text. Aber wie kann ich die Position von Newline Markup aus Textarea bekommen, so dass ich <br>
dort setzen kann?newline markup in textarea
Wenn ich im Textfeld drücken und zur neuen Zeile wechseln sollte, dann wäre es einfach, weil es eine \n
an der Stelle geben würde, wo ich drücke Enter, aber wenn ich nur Text hinzufügen und Text in den Text umwandeln neue Zeile dann habe ich keine \n
da im Text.
Ich brauche es so (nicht im Klartext);
Some text in textarea here is created without pressing enter,\n
just plain text. But how can i get the position\n
of newline markup from textarea so that i can put <br> there?\n
So i would easily replace \n with <br>
Some text in textarea here is created without pressing enter,<br>
just plain text. But how can i get the position<br>
of newline markup from textarea so that i can put <br> there? <br>
textareaContentWithJquery und textareaContentWithJavascript das gleiche Ergebnis i ohne \n
Markup bedeuten. Sie sind also nutzlos.
Sind Sie in das Textfeld mit PHP Daten für die Anzeige und diese HTML-Entitäten hat? – hmd
Ihr erstes Problem ist, dass eine neue Zeile als '\ n' nicht'/n' dargestellt wird –
ja richtig ... sorry – lowdegeneration